mirror of
https://github.com/graphql-python/graphene.git
synced 2025-09-21 11:22:33 +03:00
suggestions typos and graphene import
This commit is contained in:
parent
a6ac7d4857
commit
7ae9871eca
|
@ -30,7 +30,7 @@ Compare Graphene's *code-first* approach to building a GraphQL API with *schema-
|
|||
|
||||
.. _Ariadne: https://ariadne.readthedocs.io
|
||||
|
||||
Graphene is fully featured with integrations for the most popular web frameworks and ORM and easy Relay Compliance.
|
||||
Graphene is fully featured with integrations for the most popular web frameworks and ORMs. Graphene produces schemas tha are fully compliant with the GraphQL spec and provides tools and patterns for building a Relay-Compliant API as well.
|
||||
|
||||
An example in Graphene
|
||||
----------------------
|
||||
|
|
|
@ -28,7 +28,7 @@ This example model defines a Person, with a first and a last name:
|
|||
def resolve_full_name(parent, info):
|
||||
return f"{parent.first_name} {parent.last_name}"
|
||||
|
||||
This *ObjectType* defines the feild **first\_name**, **last\_name**, and **full\_name**. Each field is specified as a class attribute, and each attribute maps to a Field. Data is fetched by our ``resolve_full_name`` :ref:`resolver method<Resolvers>` for ``full_name`` field and the :ref:`DefaultResolver` for other fields.
|
||||
This *ObjectType* defines the field **first\_name**, **last\_name**, and **full\_name**. Each field is specified as a class attribute, and each attribute maps to a Field. Data is fetched by our ``resolve_full_name`` :ref:`resolver method<Resolvers>` for ``full_name`` field and the :ref:`DefaultResolver` for other fields.
|
||||
|
||||
The above ``Person`` ObjectType has the following schema representation:
|
||||
|
||||
|
@ -402,13 +402,13 @@ See :ref:`Interfaces` for more information.
|
|||
|
||||
.. code:: python
|
||||
|
||||
from graphene import ObjectType
|
||||
from graphene import ObjectType, Node
|
||||
|
||||
Song = namedtuple('Song', ('title', 'artist'))
|
||||
|
||||
class MyGraphQlSong(ObjectType):
|
||||
class Meta:
|
||||
interfaces = (graphene.Node, )
|
||||
interfaces = (Node, )
|
||||
possible_types = (Song, )
|
||||
|
||||
.. _Interface: /docs/interfaces/
|
||||
|
|
Loading…
Reference in New Issue
Block a user