Skip to content

Commit 5c82753

Browse files
committed
Improved docs
1 parent 19f7769 commit 5c82753

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docs/registry.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ This way, we make the library smart enough to convert automatically the
88
relations between models to Graphene fields automatically (when possible).
99

1010

11-
get_global_registry
12-
-------------------
11+
Global registry
12+
---------------
1313

1414
By default, all model/objecttype relations will live in the global registry.
15+
You retrieve using the function ``get_global_registry`` in
16+
``graphene_django.registry``.
1517

1618
.. code:: python
1719
@@ -26,12 +28,16 @@ By default, all model/objecttype relations will live in the global registry.
2628
global_registry.get_type_for_model(ReporterModel) # == Reporter
2729
2830
29-
One Model, multiple types
30-
-------------------------
31+
Multiple types for one model
32+
----------------------------
3133

3234
There will be some cases where we need one Django Model to
3335
have multiple graphene ``ObjectType``s associated to it.
3436
37+
In this case, we can either use ``skip_global_registry`` to create
38+
a new isolated registry for that type (so it doesn't interfere with
39+
the global registry), or we can create a custom registry for it.
40+
3541
.. code:: python
3642
3743
from graphene_django.registry import Registry
@@ -49,5 +55,6 @@ have multiple graphene ``ObjectType``s associated to it.
4955
# We can also specify a custom registry with
5056
# registry = Registry()
5157
58+
5259
This way, the ``ReporterModel`` could have two different types living in the same
5360
schema.

0 commit comments

Comments
 (0)