mirror of
https://github.com/graphql-python/graphene.git
synced 2025-06-19 21:13:10 +03:00
Merge pull request #428 from chappers/master
Fixed indent in mutation docs
This commit is contained in:
commit
c3ad42564a
|
@ -10,20 +10,20 @@ This example defines a Mutation:
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
import graphene
|
import graphene
|
||||||
|
|
||||||
class CreatePerson(graphene.Mutation):
|
class CreatePerson(graphene.Mutation):
|
||||||
class Input:
|
class Input:
|
||||||
name = graphene.String()
|
name = graphene.String()
|
||||||
|
|
||||||
ok = graphene.Boolean()
|
ok = graphene.Boolean()
|
||||||
person = graphene.Field(lambda: Person)
|
person = graphene.Field(lambda: Person)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def mutate(root, args, context, info):
|
def mutate(root, args, context, info):
|
||||||
person = Person(name=args.get('name'))
|
person = Person(name=args.get('name'))
|
||||||
ok = True
|
ok = True
|
||||||
return CreatePerson(person=person, ok=ok)
|
return CreatePerson(person=person, ok=ok)
|
||||||
|
|
||||||
**person** and **ok** are the output fields of the Mutation when is
|
**person** and **ok** are the output fields of the Mutation when is
|
||||||
resolved.
|
resolved.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user