You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.rst
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,11 @@ Graphene-Django
3
3
4
4
Welcome to the Graphene-Django docs.
5
5
6
-
First time? We recommend you start with the installation guide and then read the basic tutorial.
6
+
Graphene-Django is built on top of `Graphene <https://docs.graphene-python.org/en/latest/>`__.
7
+
Graphene-Django provides some additional abstractions that make it easy to add GraphQL functionality to your Django project.
8
+
9
+
First time? We recommend you start with the installation guide to get set up and the basic tutorial.
10
+
It is worth reading the `core graphene docs <https://docs.graphene-python.org/en/latest/>`__ to familiarize yourself with the basic utilities.
7
11
8
12
Core tenants
9
13
------------
@@ -22,7 +26,6 @@ For more advanced use, check out the Relay tutorial.
With Graphene-Django we can take advantage of pre-existing Django features to
10
+
quickly build CRUD functionality, while still using the core `graphene mutation <https://docs.graphene-python.org/en/latest/types/mutations/>`__
11
+
features to add custom mutations to a Django project.
12
+
13
+
Simple example
14
+
--------------
15
+
16
+
.. code:: python
17
+
18
+
import graphene
19
+
20
+
from graphene_django import DjangoObjectType
21
+
22
+
from .models import Question
23
+
24
+
25
+
classQuestionType(DjangoObjectType):
26
+
classMeta:
27
+
model = Question
28
+
29
+
30
+
classQuestionMutation(graphene.Mutation):
31
+
classInput:
32
+
# The input arguments for this mutation
33
+
text = graphene.String(required=True)
34
+
id= graphene.ID()
35
+
36
+
# The class attributes define the response of the mutation
For more information and more examples, please see the `core object type documentation <https://docs.graphene-python.org/en/latest/types/objecttypes/>`__.
177
199
178
-
For additional features such as automatic filtering and pagination, please see the Relay tutorial.
200
+
201
+
Relay
202
+
-----
203
+
204
+
`Relay <http://docs.graphene-python.org/en/latest/relay/>`__ with Graphene-Django gives us some additional features:
205
+
206
+
- Pagination and slicing.
207
+
- An abstract ``id`` value which contains enough info for the server to know its type and its id.
0 commit comments