mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-08 23:50:38 +03:00
Improved docs
This commit is contained in:
parent
6bd03d59d7
commit
c9a30f7139
|
@ -14,7 +14,7 @@ Project setup
|
|||
|
||||
.. code:: bash
|
||||
|
||||
pip install graphene --upgrade
|
||||
pip install "graphene>=1.0.dev"
|
||||
|
||||
Creating a basic Schema
|
||||
-----------------------
|
||||
|
|
|
@ -32,7 +32,7 @@ plus the ones defined in ``UserFields``.
|
|||
pass
|
||||
|
||||
|
||||
.. code:: graphql
|
||||
.. code::
|
||||
|
||||
type User {
|
||||
name: String
|
||||
|
|
|
@ -44,7 +44,7 @@ time.
|
|||
|
||||
The above types would have the following representation in a schema:
|
||||
|
||||
.. code:: graphql
|
||||
.. code::
|
||||
|
||||
interface Character {
|
||||
name: String
|
||||
|
|
|
@ -53,7 +53,7 @@ Executing the Mutation
|
|||
|
||||
Then, if we query (``schema.execute(query_str)``) the following:
|
||||
|
||||
.. code:: graphql
|
||||
.. code::
|
||||
|
||||
mutation myFirstMutation {
|
||||
createPerson(name:"Peter") {
|
||||
|
|
|
@ -8,7 +8,7 @@ querying.
|
|||
The basics:
|
||||
|
||||
- Each ObjectType is a Python class that inherits
|
||||
``graphene.ObjectType`` or inherits an implemented `Interface`_.
|
||||
``graphene.ObjectType``.
|
||||
- Each attribute of the ObjectType represents a ``Field``.
|
||||
|
||||
Quick example
|
||||
|
@ -36,7 +36,7 @@ Field.
|
|||
The above ``Person`` ObjectType would have the following representation
|
||||
in a schema:
|
||||
|
||||
.. code:: graphql
|
||||
.. code::
|
||||
|
||||
type Person {
|
||||
firstName: String
|
||||
|
|
|
@ -62,7 +62,7 @@ would be converted to ``_other_Name`` (without any other transformation).
|
|||
|
||||
So, you would need to query with:
|
||||
|
||||
.. code:: graphql
|
||||
.. code::
|
||||
|
||||
{
|
||||
lastName
|
||||
|
|
Loading…
Reference in New Issue
Block a user