mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-22 09:36:44 +03:00
fixed indent in mutation docs
This commit is contained in:
parent
ad251e9a8d
commit
3a198d052a
|
@ -10,20 +10,20 @@ This example defines a Mutation:
|
|||
|
||||
.. code:: python
|
||||
|
||||
import graphene
|
||||
import graphene
|
||||
|
||||
class CreatePerson(graphene.Mutation):
|
||||
class Input:
|
||||
name = graphene.String()
|
||||
class CreatePerson(graphene.Mutation):
|
||||
class Input:
|
||||
name = graphene.String()
|
||||
|
||||
ok = graphene.Boolean()
|
||||
person = graphene.Field(lambda: Person)
|
||||
ok = graphene.Boolean()
|
||||
person = graphene.Field(lambda: Person)
|
||||
|
||||
@staticmethod
|
||||
def mutate(root, args, context, info):
|
||||
person = Person(name=args.get('name'))
|
||||
ok = True
|
||||
return CreatePerson(person=person, ok=ok)
|
||||
@staticmethod
|
||||
def mutate(root, args, context, info):
|
||||
person = Person(name=args.get('name'))
|
||||
ok = True
|
||||
return CreatePerson(person=person, ok=ok)
|
||||
|
||||
**person** and **ok** are the output fields of the Mutation when is
|
||||
resolved.
|
||||
|
|
Loading…
Reference in New Issue
Block a user