From e90aa1b712198475e7d06df92c97fbbc3ae2a488 Mon Sep 17 00:00:00 2001 From: Min ho Kim Date: Thu, 26 Sep 2019 09:57:53 +1000 Subject: [PATCH] Fix typos (#1066) Fixed typos in docs, string literals, comments, test name --- docs/quickstart.rst | 2 +- docs/types/objecttypes.rst | 4 ++-- examples/starwars_relay/data.py | 2 +- .../starwars_relay/tests/snapshots/snap_test_mutation.py | 2 +- graphene/types/argument.py | 2 +- graphene/types/field.py | 2 +- graphene/types/inputfield.py | 2 +- graphene/types/objecttype.py | 6 +++--- graphene/types/schema.py | 2 +- graphene/types/tests/test_enum.py | 2 +- graphene/types/union.py | 2 +- graphene/types/uuid.py | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index fa012971..4ff0dfa2 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -24,7 +24,7 @@ What is Graphene? Graphene is a library that provides tools to implement a GraphQL API in Python using a *code-first* approach. -Compare Graphene's *code-first* approach to building a GraphQL API with *schema-first* approaches like `Apollo Server`_ (JavaScript) or Ariadne_ (Python). Instead of writing GraphQL **Schema Definition Langauge (SDL)**, we write Python code to describe the data provided by your server. +Compare Graphene's *code-first* approach to building a GraphQL API with *schema-first* approaches like `Apollo Server`_ (JavaScript) or Ariadne_ (Python). Instead of writing GraphQL **Schema Definition Language (SDL)**, we write Python code to describe the data provided by your server. .. _Apollo Server: https://www.apollographql.com/docs/apollo-server/ diff --git a/docs/types/objecttypes.rst b/docs/types/objecttypes.rst index 5f7272a6..f56cad9b 100644 --- a/docs/types/objecttypes.rst +++ b/docs/types/objecttypes.rst @@ -195,7 +195,7 @@ The two resolvers in this example are effectively the same. # ... -If you prefer your code to be more explict, feel free to use ``@staticmethod`` decorators. Otherwise, your code may be cleaner without them! +If you prefer your code to be more explicit, feel free to use ``@staticmethod`` decorators. Otherwise, your code may be cleaner without them! .. _DefaultResolver: @@ -251,7 +251,7 @@ GraphQL Argument defaults If you define an argument for a field that is not required (and in a query execution it is not provided as an argument) it will not be passed to the -resolver function at all. This is so that the developer can differenciate +resolver function at all. This is so that the developer can differentiate between a ``undefined`` value for an argument and an explicit ``null`` value. For example, given this schema: diff --git a/examples/starwars_relay/data.py b/examples/starwars_relay/data.py index 01231b7f..0ed654c2 100644 --- a/examples/starwars_relay/data.py +++ b/examples/starwars_relay/data.py @@ -14,7 +14,7 @@ def setup(): # Yeah, technically it's Corellian. But it flew in the service of the rebels, # so for the purposes of this demo it's a rebel ship. - falcon = Ship(id="4", name="Millenium Falcon") + falcon = Ship(id="4", name="Millennium Falcon") homeOne = Ship(id="5", name="Home One") diff --git a/examples/starwars_relay/tests/snapshots/snap_test_mutation.py b/examples/starwars_relay/tests/snapshots/snap_test_mutation.py index 4608bdaf..c35b2aeb 100644 --- a/examples/starwars_relay/tests/snapshots/snap_test_mutation.py +++ b/examples/starwars_relay/tests/snapshots/snap_test_mutation.py @@ -17,7 +17,7 @@ snapshots["test_mutations 1"] = { {"node": {"id": "U2hpcDox", "name": "X-Wing"}}, {"node": {"id": "U2hpcDoy", "name": "Y-Wing"}}, {"node": {"id": "U2hpcDoz", "name": "A-Wing"}}, - {"node": {"id": "U2hpcDo0", "name": "Millenium Falcon"}}, + {"node": {"id": "U2hpcDo0", "name": "Millennium Falcon"}}, {"node": {"id": "U2hpcDo1", "name": "Home One"}}, {"node": {"id": "U2hpcDo5", "name": "Peter"}}, ] diff --git a/graphene/types/argument.py b/graphene/types/argument.py index f0ba4c1c..cdc21d4b 100644 --- a/graphene/types/argument.py +++ b/graphene/types/argument.py @@ -30,7 +30,7 @@ class Argument(MountedType): type (class for a graphene.UnmountedType): must be a class (not an instance) of an unmounted graphene type (ex. scalar or object) which is used for the type of this argument in the GraphQL schema. - required (bool): indicates this argument as not null in the graphql scehma. Same behavior + required (bool): indicates this argument as not null in the graphql schema. Same behavior as graphene.NonNull. Default False. name (str): the name of the GraphQL argument. Defaults to parameter name. description (str): the description of the GraphQL argument in the schema. diff --git a/graphene/types/field.py b/graphene/types/field.py index d55b0347..56c2ff67 100644 --- a/graphene/types/field.py +++ b/graphene/types/field.py @@ -50,7 +50,7 @@ class Field(MountedType): object. Alternative to resolver (cannot set both source and resolver). deprecation_reason (optional, str): Setting this value indicates that the field is depreciated and may provide instruction or reason on how for clients to proceed. - required (optional, bool): indicates this field as not null in the graphql scehma. Same behavior as + required (optional, bool): indicates this field as not null in the graphql schema. Same behavior as graphene.NonNull. Default False. name (optional, str): the name of the GraphQL field (must be unique in a type). Defaults to attribute name. diff --git a/graphene/types/inputfield.py b/graphene/types/inputfield.py index ed9b96ab..b0e0915a 100644 --- a/graphene/types/inputfield.py +++ b/graphene/types/inputfield.py @@ -38,7 +38,7 @@ class InputField(MountedType): deprecation_reason (optional, str): Setting this value indicates that the field is depreciated and may provide instruction or reason on how for clients to proceed. description (optional, str): Description of the GraphQL field in the schema. - required (optional, bool): Indicates this input field as not null in the graphql scehma. + required (optional, bool): Indicates this input field as not null in the graphql schema. Raises a validation error if argument not provided. Same behavior as graphene.NonNull. Default False. **extra_args (optional, Dict): Not used. diff --git a/graphene/types/objecttype.py b/graphene/types/objecttype.py index 1fa4cf35..cca23d11 100644 --- a/graphene/types/objecttype.py +++ b/graphene/types/objecttype.py @@ -22,7 +22,7 @@ class ObjectType(BaseType): have a name, but most importantly describe their fields. The name of the type defined by an _ObjectType_ defaults to the class name. The type - description defaults to the class docstring. This can be overriden by adding attributes + description defaults to the class docstring. This can be overridden by adding attributes to a Meta inner class. The class attributes of an _ObjectType_ are mounted as instances of ``graphene.Field``. @@ -66,8 +66,8 @@ class ObjectType(BaseType): docstring. interfaces (Iterable[graphene.Interface]): GraphQL interfaces to extend with this object. all fields from interface will be included in this object's schema. - possible_types (Iterable[class]): Used to test parent value object via isintance to see if - this type can be used to resolve an ambigous type (interface, union). + possible_types (Iterable[class]): Used to test parent value object via isinstance to see if + this type can be used to resolve an ambiguous type (interface, union). default_resolver (any Callable resolver): Override the default resolver for this type. Defaults to graphene default resolver which returns an attribute or dictionary key with the same name as the field. diff --git a/graphene/types/schema.py b/graphene/types/schema.py index bf8c469a..3249c6f6 100644 --- a/graphene/types/schema.py +++ b/graphene/types/schema.py @@ -481,7 +481,7 @@ class Schema: as string or parsed AST form from `graphql-core`. root_value (Any, optional): Value to use as the parent value object when resolving root types. - context_value (Any, optional): Value to be made avaiable to all resolvers via + context_value (Any, optional): Value to be made available to all resolvers via `info.context`. Can be used to share authorization, dataloaders or other information needed to resolve an operation. variable_values (dict, optional): If variables are used in the request string, they can diff --git a/graphene/types/tests/test_enum.py b/graphene/types/tests/test_enum.py index 1c5bdb38..40cd4afd 100644 --- a/graphene/types/tests/test_enum.py +++ b/graphene/types/tests/test_enum.py @@ -172,7 +172,7 @@ def test_enum_can_be_compared(): assert RGB.BLUE == 3 -def test_enum_can_be_initialzied(): +def test_enum_can_be_initialized(): class RGB(Enum): RED = 1 GREEN = 2 diff --git a/graphene/types/union.py b/graphene/types/union.py index 194ba1da..5ae54562 100644 --- a/graphene/types/union.py +++ b/graphene/types/union.py @@ -23,7 +23,7 @@ class Union(UnmountedType, BaseType): The schema in this example can take a search text and return any of the GraphQL object types indicated: Human, Droid or Startship. - Ambigous return types can be resolved on each ObjectType through ``Meta.possible_types`` + Ambiguous return types can be resolved on each ObjectType through ``Meta.possible_types`` attribute or ``is_type_of`` method. Or by implementing ``resolve_type`` class method on the Union. diff --git a/graphene/types/uuid.py b/graphene/types/uuid.py index 1f980fc7..ef09ae6c 100644 --- a/graphene/types/uuid.py +++ b/graphene/types/uuid.py @@ -8,7 +8,7 @@ from .scalars import Scalar class UUID(Scalar): """ - Leverages the internal Python implmeentation of UUID (uuid.UUID) to provide native UUID objects + Leverages the internal Python implementation of UUID (uuid.UUID) to provide native UUID objects in fields, resolvers and input. """