graphql-python / graphql-python/graphql-core

I use middleware for that right now

Open
#215 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
531
Forks
146
PR merge metrics
No merged PRs in 30d

Description

I use middleware for that right now

```python
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](https://github.com/graphql-python/graphene/issues/907#issuecomment-484014679), but it gives an error "Cannot return null for non-nullable field Query.__schema."

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.