From 3710531f3e5871541bda3d746dc6fc1111e789c6 Mon Sep 17 00:00:00 2001 From: Zbigniew Siciarz Date: Thu, 3 Oct 2019 15:52:52 +0200 Subject: [PATCH] Fix argument list in middleware docs Using the literal example for AuthorizationMiddleware leads to the following error: `graphql.error.located_error.GraphQLLocatedError: resolve() takes 3 positional arguments but 4 were given` If `AuthorizationMiddleware` is to be instantiated, it should receive `self` as the first argument. --- docs/execution/middleware.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/execution/middleware.rst b/docs/execution/middleware.rst index ad109e44..2a5e20f7 100644 --- a/docs/execution/middleware.rst +++ b/docs/execution/middleware.rst @@ -29,7 +29,7 @@ This middleware only continues evaluation if the ``field_name`` is not ``'user'` .. code:: python class AuthorizationMiddleware(object): - def resolve(next, root, info, **args): + def resolve(self, next, root, info, **args): if info.field_name == 'user': return None return next(root, info, **args)