diff --git a/graphene/types/enum.py b/graphene/types/enum.py index 5a21e32f..8c95efbe 100644 --- a/graphene/types/enum.py +++ b/graphene/types/enum.py @@ -68,7 +68,7 @@ class EnumMeta(SubclassWithMeta_Meta): class Enum(six.with_metaclass(EnumMeta, UnmountedType, BaseType)): """ - Enum type defintion + Enum type definition Defines a static set of values that can be provided as a Field, Argument or InputField. @@ -83,9 +83,9 @@ class Enum(six.with_metaclass(EnumMeta, UnmountedType, BaseType)): Meta: enum (optional, Enum): Python enum to use as a base for GraphQL Enum. - name (optional, str): the name of the GraphQL type (must be unique in schema). Defaults to class + name (optional, str): Name of the GraphQL type (must be unique in schema). Defaults to class name. - description (optional, str): the description of the GraphQL type in the schema. Defaults to class + description (optional, str): Description of the GraphQL type in the schema. Defaults to class docstring. deprecation_reason (optional, str): Setting this value indicates that the enum is depreciated and may provide instruction or reason on how for clients to proceed. diff --git a/graphene/types/mutation.py b/graphene/types/mutation.py index 9c7355c9..b238ba14 100644 --- a/graphene/types/mutation.py +++ b/graphene/types/mutation.py @@ -29,12 +29,14 @@ class Mutation(ObjectType): .. code:: python - class CreatePerson(graphene.Mutation): - class Arguments: - name = graphene.String() + from graphene import Mutation, String, Boolean, Field - ok = graphene.Boolean() - person = graphene.Field(Person) + class CreatePerson(Mutation): + class Arguments: + name = String() + + ok = Boolean() + person = Field(Person) def mutate(parent, info, name): person = Person(name=name) diff --git a/graphene/types/union.py b/graphene/types/union.py index 38e4a0a8..194ba1da 100644 --- a/graphene/types/union.py +++ b/graphene/types/union.py @@ -29,12 +29,14 @@ class Union(UnmountedType, BaseType): .. code:: python - class SearchResult(graphene.Union): + from graphene import Union, ObjectType, List + + class SearchResult(Union): class Meta: types = (Human, Droid, Starship) - class Query(graphene.ObjectType): - search = graphene.List(SearchResult.Field( + class Query(ObjectType): + search = List(SearchResult.Field( search_text=String(description='Value to search for')) )