How to use middleware after resolver in graphene?

Viewed 1493

Using Graphql in Node, you can use middlewares BEFORE or AFTER the resolver, using, for example, Prisma.

In Python, using Graphene, I could only find a way to use middleware BEFORE the resolver.

Is there a way to use middlewares AFTER the resolver in Python?

1 Answers

How about:

class SomeMiddleware(object):
    def resolve(self, next, root, info, **args):
        next_node = next(root, info, **args)
        ...logic...
        return next_node
Related