mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-22 17:46:57 +03:00
Merge pull request #1381 from belkka/patch-1
Avoid ambiguity in graphene.Mutation docstring [documentation]
This commit is contained in:
commit
97abb9db42
|
@ -29,21 +29,21 @@ class Mutation(ObjectType):
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
from graphene import Mutation, ObjectType, String, Boolean, Field
|
import graphene
|
||||||
|
|
||||||
class CreatePerson(Mutation):
|
class CreatePerson(graphene.Mutation):
|
||||||
class Arguments:
|
class Arguments:
|
||||||
name = String()
|
name = graphene.String()
|
||||||
|
|
||||||
ok = Boolean()
|
ok = graphene.Boolean()
|
||||||
person = Field(Person)
|
person = graphene.Field(Person)
|
||||||
|
|
||||||
def mutate(parent, info, name):
|
def mutate(parent, info, name):
|
||||||
person = Person(name=name)
|
person = Person(name=name)
|
||||||
ok = True
|
ok = True
|
||||||
return CreatePerson(person=person, ok=ok)
|
return CreatePerson(person=person, ok=ok)
|
||||||
|
|
||||||
class Mutation(ObjectType):
|
class Mutation(graphene.ObjectType):
|
||||||
create_person = CreatePerson.Field()
|
create_person = CreatePerson.Field()
|
||||||
|
|
||||||
Meta class options (optional):
|
Meta class options (optional):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user