@envelop/core
6.0.1 · 12 Nov 2026MIT12.6M / weekRepositoryHomepagenpmAtom feed
2.6.0 is the newest release of 2.x.
In short
1 breaking2 new1 internal
- Breaking
Move
onResolverCalledfrom withinOnExecuteHookResultandOnSubscribeHookResultto thePlugintype.
Release note
The section about @envelop/core of a note shared by several packages.
Major Changes
- Breaking
Move
onResolverCalledfrom withinOnExecuteHookResultandOnSubscribeHookResultto
thePlugintype.import type { Plugin } from "@envelop/core"; const plugin: Plugin = { onExecute() { - return { - onResolverCalled() {} - } - } + }, + onResolverCalled() {}, }We highly recommend avoiding to use any plugins that use
onResolverCalledwithin your production
environment as it has severe impact on the performance of the individual resolver functions within
your schema.The schema resolver functions are now ONLY wrapped if any plugin in your envelop setup uses the
onResolverCalledhook.If you need any shared state between
onExecuteandonResolverCalledyou can share it by
extending the context object.import type { Plugin } from '@envelop/core' const sharedStateSymbol = Symbol('sharedState') const plugin: Plugin = { onExecute({ extendContext }) { extendContext({ [sharedStateSymbol]: { value: 1 } }) }, onResolverCalled({ context }) { const sharedState = context[sharedStateSymbol] // logs 1 console.log(sharedState.value) } }
Minor Changes
Add new option
breakContextBuildingtoOnContextBuildingEventPayload.This allows short-circuiting the context building phase. Please use this with care as careless
usage of it can result in severe errors during the execution phase, as the context might not
include all the fields your schema resolvers need.Add new plugin
useImmediateIntrospectionfor speeding up introspection only operations
by skipping context building.import { envelop, useImmediateIntrospection } from '@envelop/core' import { schema } from './schema' const getEnveloped = envelop({ plugins: [ useSchema(schema), useImmediateIntrospection() // additional plugins ] })
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.