mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 23:20:47 +03:00
Fixed examples
This commit is contained in:
parent
1d8f5ded33
commit
42b93b5546
|
@ -17,6 +17,11 @@ class Ship(graphene.ObjectType):
|
|||
return get_ship(id)
|
||||
|
||||
|
||||
class ShipConnection(graphene.Connection):
|
||||
class Meta:
|
||||
node = Ship
|
||||
|
||||
|
||||
class Faction(graphene.ObjectType):
|
||||
'''A faction in the Star Wars saga'''
|
||||
|
||||
|
@ -24,7 +29,7 @@ class Faction(graphene.ObjectType):
|
|||
interfaces = (relay.Node, )
|
||||
|
||||
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
|
||||
def resolve_ships(self, **args):
|
||||
|
|
Loading…
Reference in New Issue
Block a user