graphql-core icon indicating copy to clipboard operation
graphql-core copied to clipboard

I use middleware for that right now

Open amansingh0912 opened this issue 1 year ago • 1 comments

          I use middleware for that right now
class HideIntrospectMiddleware:
    """
    This middleware should use for production mode. This class hide the
    introspection.
    """
    def resolve(self, next, root, info, **args):
        if info.field_name == '__schema':
            return None
        return next(root, info, **args)

Originally posted by @Arfey in a Graphene issue, but it gives an error "Cannot return null for non-nullable field Query.__schema."

amansingh0912 avatar Mar 08 '24 07:03 amansingh0912

Can you please change the title and description to make this an actually relevant issue. Is this a request, bug report, or suggestion?

Cito avatar Mar 08 '24 10:03 Cito