Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants