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

@envelop/immediate-introspection

Package Overview
Dependencies
Maintainers
2
Versions
1291
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@envelop/immediate-introspection

## Getting Started

latest
Source
npmnpm
Version
6.0.0
Version published
Maintainers
2
Created
Source

@envelop/immediate-introspection

Getting Started

yarn add @envelop/immediate-introspection

Usage Example

Context building can be costly and require calling remote services. For simple GraphQL operations that only select introspection fields building a context is not necessary.

The useImmediateIntrospection can be used to short circuit any further context building if a GraphQL operation selection set only includes introspection fields within the selection set.

import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { envelop, useEngine, useImmediateIntrospection } from '@envelop/core'
import { schema } from './schema'

const getEnveloped = envelop({
  plugins: [
    useEngine({ parse, validate, specifiedRules, execute, subscribe }),
    useSchema(schema),
    useImmediateIntrospection()
    // additional plugins
  ]
})

In case you want to authorize that an user is authenticated before allowing introspection the plugin must be placed in front of the useImmediateIntrospection() call.

import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { envelop, useEngine, useImmediateIntrospection } from '@envelop/core'
import { schema } from './schema'
import { useAuthorization } from './useAuthorization'

const getEnveloped = envelop({
  plugins: [
    useEngine({ parse, validate, specifiedRules, execute, subscribe }),
    useSchema(schema),
    useAuthorization(), // place this before
    useImmediateIntrospection()
    // additional plugins
  ]
})

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