Skip to content

Commit a6ac7d4

Browse files
committed
rename doc refs for resolvers
1 parent ab25d07 commit a6ac7d4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/execution/execute.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ You can pass variables to a query via ``variables``.
7373
Root Value
7474
__________
7575

76-
Value used for :ref:`ResolverRootArgument` in root queries and mutations can be overridden using ``root`` parameter.
76+
Value used for :ref:`ResolverParamParent` in root queries and mutations can be overridden using ``root`` parameter.
7777

7878
.. code:: python
7979

docs/types/objecttypes.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ Resolvers are lazily executed, so if a field is not included in a query, its res
5252
Each field on an *ObjectType* in Graphene should have a corresponding resolver method to fetch data. This resolver method should match the field name. For example, in the ``Person`` type above, the ``full_name`` field is resolved by the method ``resolve_full_name``.
5353

5454
Each resolver method takes the parameters:
55-
* :ref:`ResolverRootArgument` for the value object use to resolve most fields
56-
* :ref:`ResolverInfoArgument` for query and schema meta information and per-request context
57-
* :ref:`ResolverGraphQLArguments` as defined on the **Field**.
55+
* :ref:`ResolverParamParent` for the value object use to resolve most fields
56+
* :ref:`ResolverParamInfo` for query and schema meta information and per-request context
57+
* :ref:`ResolverParamGraphQLArguments` as defined on the **Field**.
5858

5959
.. _ResolverArguments:
6060

6161
Resolver Parameters
6262
~~~~~~~~~~~~~~~~~~~
6363

64-
.. _ResolverRootArgument:
64+
.. _ResolverParamParent:
6565

6666
Parent Value Object (*parent*)
6767
******************************
@@ -110,14 +110,14 @@ Then we go through the following steps to resolve this query:
110110
* This value object is then used as ``parent`` while calling ``Person.resolve_full_name`` to resolve the scalar String value "Luke Skywalker".
111111
* The scalar value is serialized and sent back in the query response.
112112
113-
Each resolver returns the next :ref:`ResolverRootArgument` to be used in executing the following resolver in the chain. If the Field is a Scalar type, that value will be serialized and sent in the **Response**. Otherwise, while resolving Compound types like *ObjectType*, the value be passed forward as the next :ref:`ResolverRootArgument`.
113+
Each resolver returns the next :ref:`ResolverParamParent` to be used in executing the following resolver in the chain. If the Field is a Scalar type, that value will be serialized and sent in the **Response**. Otherwise, while resolving Compound types like *ObjectType*, the value be passed forward as the next :ref:`ResolverParamParent`.
114114
115115
Naming convention
116116
^^^^^^^^^^^^^^^^^
117117
118-
This :ref:`ResolverRootArgument` is sometimes named ``obj``, ``parent``, or ``source`` in other GraphQL documentation. It can also be named after the value object being resolved (ex. ``root`` for a root Query or Mutation, and ``person`` for a Person value object). Sometimes this argument will be named ``self`` in Graphene code, but this can be misleading due to :ref:`ResolverImplicitStaticMethod` while executing queries in Graphene.
118+
This :ref:`ResolverParamParent` is sometimes named ``obj``, ``parent``, or ``source`` in other GraphQL documentation. It can also be named after the value object being resolved (ex. ``root`` for a root Query or Mutation, and ``person`` for a Person value object). Sometimes this argument will be named ``self`` in Graphene code, but this can be misleading due to :ref:`ResolverImplicitStaticMethod` while executing queries in Graphene.
119119
120-
.. _ResolverInfoArgument:
120+
.. _ResolverParamInfo:
121121
122122
GraphQL Execution Info (*info*)
123123
*******************************
@@ -129,7 +129,7 @@ The second parameter provides two things:
129129
130130
Only context will be required for most applications. See :ref:`SchemaExecuteContext` for more information about setting context.
131131
132-
.. _ResolverGraphQLArguments:
132+
.. _ResolverParamGraphQLArguments:
133133
134134
GraphQL Arguments (*\*\*kwargs*)
135135
********************************
@@ -166,7 +166,7 @@ Convenience Features of Graphene Resolvers
166166
Implicit staticmethod
167167
*********************
168168
169-
One surprising feature of Graphene is that all resolver methods are treated implicitly as staticmethods. This means that, unlike other methods in Python, the first argument of a resolver is *never* ``self`` while it is being executed by Graphene. Instead, the first argument is always :ref:`ResolverRootArgument`. In practice, this is very convenient as, in GraphQL, we are almost always more concerned with the using the parent value object to resolve queries than attributes on the Python object itself.
169+
One surprising feature of Graphene is that all resolver methods are treated implicitly as staticmethods. This means that, unlike other methods in Python, the first argument of a resolver is *never* ``self`` while it is being executed by Graphene. Instead, the first argument is always :ref:`ResolverParamParent`. In practice, this is very convenient as, in GraphQL, we are almost always more concerned with the using the parent value object to resolve queries than attributes on the Python object itself.
170170
171171
The two resolvers in this example are effectively the same.
172172
@@ -204,7 +204,7 @@ Default Resolver
204204
205205
If a resolver method is not defined for a **Field** attribute on our *ObjectType*, Graphene supplies a default resolver.
206206
207-
If the :ref:`ResolverRootArgument` is a dictionary, the resolver will look for a dictionary key matching the field name. Otherwise, the resolver will get the attribute from the parent value object matching the field name.
207+
If the :ref:`ResolverParamParent` is a dictionary, the resolver will look for a dictionary key matching the field name. Otherwise, the resolver will get the attribute from the parent value object matching the field name.
208208
209209
.. code:: python
210210

0 commit comments

Comments
 (0)