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
|
.. code:: bash
|
||||||
|
|
||||||
pip install graphene --upgrade
|
pip install "graphene>=1.0.dev"
|
||||||
|
|
||||||
Creating a basic Schema
|
Creating a basic Schema
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
|
@ -32,7 +32,7 @@ plus the ones defined in ``UserFields``.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
.. code:: graphql
|
.. code::
|
||||||
|
|
||||||
type User {
|
type User {
|
||||||
name: String
|
name: String
|
||||||
|
|
|
@ -44,7 +44,7 @@ time.
|
||||||
|
|
||||||
The above types would have the following representation in a schema:
|
The above types would have the following representation in a schema:
|
||||||
|
|
||||||
.. code:: graphql
|
.. code::
|
||||||
|
|
||||||
interface Character {
|
interface Character {
|
||||||
name: String
|
name: String
|
||||||
|
|
|
@ -53,7 +53,7 @@ Executing the Mutation
|
||||||
|
|
||||||
Then, if we query (``schema.execute(query_str)``) the following:
|
Then, if we query (``schema.execute(query_str)``) the following:
|
||||||
|
|
||||||
.. code:: graphql
|
.. code::
|
||||||
|
|
||||||
mutation myFirstMutation {
|
mutation myFirstMutation {
|
||||||
createPerson(name:"Peter") {
|
createPerson(name:"Peter") {
|
||||||
|
|
|
@ -8,7 +8,7 @@ querying.
|
||||||
The basics:
|
The basics:
|
||||||
|
|
||||||
- Each ObjectType is a Python class that inherits
|
- 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``.
|
- Each attribute of the ObjectType represents a ``Field``.
|
||||||
|
|
||||||
Quick example
|
Quick example
|
||||||
|
@ -36,7 +36,7 @@ Field.
|
||||||
The above ``Person`` ObjectType would have the following representation
|
The above ``Person`` ObjectType would have the following representation
|
||||||
in a schema:
|
in a schema:
|
||||||
|
|
||||||
.. code:: graphql
|
.. code::
|
||||||
|
|
||||||
type Person {
|
type Person {
|
||||||
firstName: String
|
firstName: String
|
||||||
|
|
|
@ -62,7 +62,7 @@ would be converted to ``_other_Name`` (without any other transformation).
|
||||||
|
|
||||||
So, you would need to query with:
|
So, you would need to query with:
|
||||||
|
|
||||||
.. code:: graphql
|
.. code::
|
||||||
|
|
||||||
{
|
{
|
||||||
lastName
|
lastName
|
||||||
|
|
Loading…
Reference in New Issue
Block a user