Fixed examples

This commit is contained in:
Syrus Akbary 2016-11-03 00:36:14 -07:00
parent 1d8f5ded33
commit 42b93b5546

View File

@ -17,6 +17,11 @@ class Ship(graphene.ObjectType):
return get_ship(id) return get_ship(id)
class ShipConnection(graphene.Connection):
class Meta:
node = Ship
class Faction(graphene.ObjectType): class Faction(graphene.ObjectType):
'''A faction in the Star Wars saga''' '''A faction in the Star Wars saga'''
@ -24,7 +29,7 @@ class Faction(graphene.ObjectType):
interfaces = (relay.Node, ) interfaces = (relay.Node, )
name = graphene.String(description='The name of the faction.') name = graphene.String(description='The name of the faction.')
ships = relay.ConnectionField(Ship, description='The ships used by the faction.') ships = ShipConnection.Field(description='The ships used by the faction.')
@resolve_only_args @resolve_only_args
def resolve_ships(self, **args): def resolve_ships(self, **args):