mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-25 11:04:11 +03:00
Fixed examples
This commit is contained in:
parent
7768d1466b
commit
a7034baa03
|
@ -16,7 +16,7 @@ class Ship(DjangoObjectType):
|
||||||
interfaces = (relay.Node, )
|
interfaces = (relay.Node, )
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_node(cls, id, context, info):
|
def get_node(cls, info, id):
|
||||||
node = get_ship(id)
|
node = get_ship(id)
|
||||||
return node
|
return node
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class Faction(DjangoObjectType):
|
||||||
interfaces = (relay.Node, )
|
interfaces = (relay.Node, )
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_node(cls, id, context, info):
|
def get_node(cls, info, id):
|
||||||
return get_faction(id)
|
return get_faction(id)
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,9 +48,7 @@ class IntroduceShip(relay.ClientIDMutation):
|
||||||
faction = graphene.Field(Faction)
|
faction = graphene.Field(Faction)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def mutate_and_get_payload(cls, input, context, info):
|
def mutate_and_get_payload(cls, root, info, ship_name, faction_id, client_mutation_id=None):
|
||||||
ship_name = input.get('ship_name')
|
|
||||||
faction_id = input.get('faction_id')
|
|
||||||
ship = create_ship(ship_name, faction_id)
|
ship = create_ship(ship_name, faction_id)
|
||||||
faction = get_faction(faction_id)
|
faction = get_faction(faction_id)
|
||||||
return IntroduceShip(ship=ship, faction=faction)
|
return IntroduceShip(ship=ship, faction=faction)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user