mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-25 19:13:57 +03:00
Improved mutation docs
This commit is contained in:
parent
5c58d9e686
commit
fa512cfa50
|
@ -22,8 +22,8 @@ subclass of ``relay.ClientIDMutation``.
|
|||
|
||||
@classmethod
|
||||
def mutate_and_get_payload(cls, input, context, info):
|
||||
ship_name = input.get('ship_name')
|
||||
faction_id = input.get('faction_id')
|
||||
ship_name = input.ship_name
|
||||
faction_id = input.faction_id
|
||||
ship = create_ship(ship_name, faction_id)
|
||||
faction = get_faction(faction_id)
|
||||
return IntroduceShip(ship=ship, faction=faction)
|
||||
|
|
|
@ -13,7 +13,7 @@ This example defines a Mutation:
|
|||
import graphene
|
||||
|
||||
class CreatePerson(graphene.Mutation):
|
||||
class Input:
|
||||
class Arguments:
|
||||
name = graphene.String()
|
||||
|
||||
ok = graphene.Boolean()
|
||||
|
@ -98,7 +98,7 @@ To use an InputField you define an InputObjectType that specifies the structure
|
|||
age = graphene.Int(required=True)
|
||||
|
||||
class CreatePerson(graphene.Mutation):
|
||||
class Input:
|
||||
class Arguments:
|
||||
person_data = PersonInput(required=True)
|
||||
|
||||
person = graphene.Field(Person)
|
||||
|
|
Loading…
Reference in New Issue
Block a user