Merge pull request #1381 from belkka/patch-1

Avoid ambiguity in graphene.Mutation docstring [documentation]
This commit is contained in:
Erik Wrede 2022-08-13 15:19:52 +02:00 committed by GitHub
commit 97abb9db42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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):