Add note about the use of args

Closes #1037
This commit is contained in:
Jonathan Kim 2020-04-01 16:11:09 +01:00
parent cb3bfe011f
commit 9be3922ad5

View File

@ -158,6 +158,22 @@ You can then execute the following query:
} }
} }
*Note:* There are several arguments to a field that are "reserved" by Graphene
(you can see the full list here: https://docs.graphene-python.org/en/latest/api/#fields-mounted-types).
You can still define an argument that clashes with one of these fields by using
the ``args`` paramter like so:
.. code:: python
from graphene import ObjectType, Field, String
class Query(ObjectType):
answer = graphene.Int(args={'description': graphene.Int()})
def resolve_answer(parent, info, description):
return description
Convenience Features of Graphene Resolvers Convenience Features of Graphene Resolvers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~