This commit is contained in:
Daniele Bernardini 2018-08-29 11:50:04 +00:00 committed by GitHub
commit a680236b50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,18 @@ And then execute it with:
result = schema.execute('THE QUERY', middleware=[AuthorizationMiddleware()])
Or set it up in the default middleware to be executed for every query in settings.py:
.. code:: python
GRAPHENE = {
'SCHEMA': 'my_app.schema.schema'
'MIDDLEWARE': (
'graphene_django.debug.DjangoDebugMiddleware',
'mymodule.AuthorizationMiddleware'
)
}
Functional example
------------------
@ -69,3 +81,4 @@ And then execute it with:
.. code:: python
result = schema.execute('THE QUERY', middleware=[timing_middleware])