From a9625dac0ed07d5fb35adc83cbc41387755f080f Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Thu, 25 Jun 2020 03:22:22 +0100 Subject: [PATCH] Update requirement for Query type in mutation docs (#1213) --- docs/types/mutations.rst | 6 +----- graphene/types/schema.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/types/mutations.rst b/docs/types/mutations.rst index f8c76f35..543f39b4 100644 --- a/docs/types/mutations.rst +++ b/docs/types/mutations.rst @@ -48,11 +48,7 @@ So, we can finish our schema like this: class MyMutations(graphene.ObjectType): create_person = CreatePerson.Field() - # We must define a query for our schema - class Query(graphene.ObjectType): - person = graphene.Field(Person) - - schema = graphene.Schema(query=Query, mutation=MyMutations) + schema = graphene.Schema(mutation=MyMutations) Executing the Mutation ---------------------- diff --git a/graphene/types/schema.py b/graphene/types/schema.py index 29ead4a7..0b6e9dac 100644 --- a/graphene/types/schema.py +++ b/graphene/types/schema.py @@ -381,7 +381,7 @@ class Schema: questions about the types through introspection. Args: - query (Type[ObjectType]): Root query *ObjectType*. Describes entry point for fields to *read* + query (Optional[Type[ObjectType]]): Root query *ObjectType*. Describes entry point for fields to *read* data in your Schema. mutation (Optional[Type[ObjectType]]): Root mutation *ObjectType*. Describes entry point for fields to *create, update or delete* data in your API.