Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable introspection for production? #50

Closed
wanton7 opened this issue Sep 16, 2021 · 2 comments
Closed

How to disable introspection for production? #50

wanton7 opened this issue Sep 16, 2021 · 2 comments

Comments

@wanton7
Copy link

wanton7 commented Sep 16, 2021

I would like to disable introspection for production environment. Is it possible with graphql-helix?

@orefalo
Copy link

orefalo commented Sep 18, 2021

same issue

@dotansimha
Copy link
Contributor

You can either modify the validationRules and use NoSchemaIntrospectionCustomRule in addition to the default set of rules:

import { specifiedRules, NoSchemaIntrospectionCustomRule } from 'graphql';

// ... 

processRequest({
  // ...
  validationRules: [...specifiedRules, NoSchemaIntrospectionCustomRule]
})

Or, you can use envelop (https://github.com/dotansimha/envelop/) and configure it using the plugin (https://www.envelop.dev/plugins/use-disable-introspection)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants