Skip to content

Commit 223d0b1

Browse files
authored
Merge pull request #627 from graphql-python/custom-choices
Add documentation for settings
2 parents c0fbed2 + bd53940 commit 223d0b1

File tree

2 files changed

+104
-1
lines changed

2 files changed

+104
-1
lines changed

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ For more advanced use, check out the Relay tutorial.
2929
filtering
3030
authorization
3131
debug
32-
rest-framework
3332
introspection
3433
testing
34+
settings

docs/settings.rst

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
Settings
2+
========
3+
4+
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.
96+
97+
Default: ``100``
98+
99+
.. code:: python
100+
101+
GRAPHENE = {
102+
'RELAY_CONNECTION_MAX_LIMIT': 100,
103+
}

0 commit comments

Comments
 (0)