graphql-python / graphql-core

A Python 3.6+ port of the GraphQL.js reference implementation of GraphQL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I use middleware for that right now

amansingh0912 opened this issue · 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."

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