Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@envelop/disable-introspection

Package Overview
Dependencies
Maintainers
2
Versions
1404
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@envelop/disable-introspection

This plugin injects the `NoSchemaIntrospectionCustomRule` validation rule exported from the `graphql` module to the validation phase for disabling introspection.

latest
Source
npmnpm
Version
8.0.0
Version published
Weekly downloads
60K
12.84%
Maintainers
2
Weekly downloads
 
Created
Source

@envelop/disable-introspection

This plugin injects the NoSchemaIntrospectionCustomRule validation rule exported from the graphql module to the validation phase for disabling introspection.

Getting Started

yarn add @envelop/disable-introspection

Usage Example

import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { envelop, useEngine } from '@envelop/core'
import { useDisableIntrospection } from '@envelop/disable-introspection'

const getEnveloped = envelop({
  plugins: [
    useEngine({ parse, validate, specifiedRules, execute, subscribe }),
    useDisableIntrospection()
  ]
})

Optional configuration

The plugin optionally accepts a configuration object:

{
  disableIf?: ({context, params}) => boolean
}
  • disableIf: A function that allow you to evaluate the need to disable introspection, based on the incoming operation. If introspection needs to be disabled/enabled based on the dynamic parameter (GraphQL operation, or, incoming request/headers), use this function to determine when introspection needs to be disabled. Return true for disabling the introspection for the incoming operation, or false to allow introspection.

FAQs

Package last updated on 20 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts