mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-22 09:36:44 +03:00
Fixed middleware docs to use whitespaces instead of tabs
This commit is contained in:
parent
bd754c1989
commit
b71a2cb69e
|
@ -30,15 +30,15 @@ This middleware only continues evaluation if the ``field_name`` is not ``'user'`
|
|||
|
||||
.. code:: python
|
||||
|
||||
class AuthorizationMiddleware(object):
|
||||
def resolve(self, next, root, args, context, info):
|
||||
if info.field_name == 'user':
|
||||
return None
|
||||
return next(root, args, context, info)
|
||||
class AuthorizationMiddleware(object):
|
||||
def resolve(self, next, root, args, context, info):
|
||||
if info.field_name == 'user':
|
||||
return None
|
||||
return next(root, args, context, info)
|
||||
|
||||
|
||||
And then execute it with:
|
||||
|
||||
.. code:: python
|
||||
|
||||
result = schema.execute('THE QUERY', middleware=[AuthorizationMiddleware()])
|
||||
result = schema.execute('THE QUERY', middleware=[AuthorizationMiddleware()])
|
||||
|
|
Loading…
Reference in New Issue
Block a user