mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-25 11:03:58 +03:00
commit
80066e55f3
|
@ -1,7 +1,7 @@
|
|||
Enums
|
||||
=====
|
||||
|
||||
A ``Enum`` is a special ``GraphQL`` type that represents a set of
|
||||
An ``Enum`` is a special ``GraphQL`` type that represents a set of
|
||||
symbolic names (members) bound to unique, constant values.
|
||||
|
||||
Definition
|
||||
|
|
|
@ -91,7 +91,7 @@ For example, you can define a field ``hero`` that resolves to any
|
|||
schema = graphene.Schema(query=Query, types=[Human, Droid])
|
||||
|
||||
This allows you to directly query for fields that exist on the Character interface
|
||||
as well as selecting specific fields on any type that implments the interface
|
||||
as well as selecting specific fields on any type that implements the interface
|
||||
using `inline fragments <https://graphql.org/learn/queries/#inline-fragments>`_.
|
||||
|
||||
For example, the following query:
|
||||
|
|
|
@ -46,13 +46,13 @@ The above ``Person`` ObjectType has the following schema representation:
|
|||
Resolvers
|
||||
---------
|
||||
|
||||
A resolver is a method that resolves certain fields within a
|
||||
A resolver is a method that resolves certain fields within an
|
||||
``ObjectType``. If not specified otherwise, the resolver of a
|
||||
field is the ``resolve_{field_name}`` method on the ``ObjectType``.
|
||||
|
||||
By default resolvers take the arguments ``info`` and ``*args``.
|
||||
|
||||
NOTE: The resolvers on a ``ObjectType`` are always treated as ``staticmethod``\ s,
|
||||
NOTE: The resolvers on an ``ObjectType`` are always treated as ``staticmethod``\ s,
|
||||
so the first argument to the resolver method ``self`` (or ``root``) need
|
||||
not be an actual instance of the ``ObjectType``.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user