Fixed middleware docs to use whitespaces instead of tabs

This commit is contained in:
Syrus Akbary 2017-04-20 00:34:05 -07:00
parent bd754c1989
commit b71a2cb69e

View File

@ -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()])