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
Graphene-Django can be customised using settings. This page explains each setting and their defaults.
5
+
6
+
Usage
7
+
-----
8
+
9
+
Add settings to your Django project by creating a Dictonary with name ``GRAPHENE`` in the project's ``settings.py``:
10
+
11
+
.. code:: python
12
+
13
+
GRAPHENE= {
14
+
...
15
+
}
16
+
17
+
18
+
``SCHEMA``
19
+
----------
20
+
21
+
The location of the top-level ``Schema`` class.
22
+
23
+
Default: ``None``
24
+
25
+
.. code:: python
26
+
27
+
GRAPHENE= {
28
+
'SCHEMA': 'path.to.schema.schema',
29
+
}
30
+
31
+
32
+
``SCHEMA_OUTPUT``
33
+
----------
34
+
35
+
The name of the file where the GraphQL schema output will go.
36
+
37
+
Default: ``schema.json``
38
+
39
+
.. code:: python
40
+
41
+
GRAPHENE= {
42
+
'SCHEMA_OUTPUT': 'schema.json',
43
+
}
44
+
45
+
46
+
``SCHEMA_INDENT``
47
+
----------
48
+
49
+
The indentation level of the schema output.
50
+
51
+
Default: ``2``
52
+
53
+
.. code:: python
54
+
55
+
GRAPHENE= {
56
+
'SCHEMA_INDENT': 2,
57
+
}
58
+
59
+
60
+
``MIDDLEWARE``
61
+
----------
62
+
63
+
A tuple of middleware that will be executed for each GraphQL query.
64
+
65
+
See the `middleware documentation <https://docs.graphene-python.org/en/latest/execution/middleware/>`__ for more information.
66
+
67
+
Default: ``()``
68
+
69
+
.. code:: python
70
+
71
+
GRAPHENE= {
72
+
'MIDDLEWARE': (
73
+
'path.to.my.middleware.class',
74
+
),
75
+
}
76
+
77
+
78
+
``RELAY_CONNECTION_ENFORCE_FIRST_OR_LAST``
79
+
----------
80
+
81
+
Enforces relay queries to have the ``first`` or ``last`` argument.
82
+
83
+
Default: ``False``
84
+
85
+
.. code:: python
86
+
87
+
GRAPHENE= {
88
+
'RELAY_CONNECTION_ENFORCE_FIRST_OR_LAST': False,
89
+
}
90
+
91
+
92
+
``RELAY_CONNECTION_MAX_LIMIT``
93
+
----------
94
+
95
+
The maximum size of objects that can be requested through a relay connection.
0 commit comments