mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-22 09:37:07 +03:00
Fixed starwars schema
This commit is contained in:
parent
5cba3f67fe
commit
4127031d2a
|
@ -1,6 +1,6 @@
|
|||
import graphene
|
||||
from graphene import Schema, relay, resolve_only_args
|
||||
from graphene_django import DjangoObjectType
|
||||
from graphene_django import DjangoObjectType, DjangoConnectionField
|
||||
|
||||
from .data import (create_ship, get_empire, get_faction, get_rebels, get_ship,
|
||||
get_ships)
|
||||
|
@ -18,7 +18,6 @@ class Ship(DjangoObjectType):
|
|||
@classmethod
|
||||
def get_node(cls, id, context, info):
|
||||
node = get_ship(id)
|
||||
print(node)
|
||||
return node
|
||||
|
||||
|
||||
|
@ -61,7 +60,7 @@ class Query(graphene.ObjectType):
|
|||
rebels = graphene.Field(Faction)
|
||||
empire = graphene.Field(Faction)
|
||||
node = relay.Node.Field()
|
||||
ships = relay.ConnectionField(Ship, description='All the ships.')
|
||||
ships = DjangoConnectionField(Ship, description='All the ships.')
|
||||
|
||||
@resolve_only_args
|
||||
def resolve_ships(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user