@envelop/core
6.0.1 · 12 Nov 2026MIT12.6M / weekRepositoryHomepagenpmAtom feed
3.0.6 is the newest release of 3.x.
In short
1 breaking
- Breaking
Remove
isIntrospectionQueryutility
Release note
The section about @envelop/core of a note shared by several packages.
Major Changes
- Breaking
#1487
dc1e24b5
Thanks @saihaj! - RemoveisIntrospectionQueryutility - Breaking
#1487
dc1e24b5
Thanks @saihaj! - Remove async schema loading plugin. This was a
mistake from beginning as we cannot asynchronouslyvalidateandparsesince with GraphQL.js
are synchronous in nature. - Breaking
#1487
dc1e24b5
Thanks @saihaj! - RemoveonResolverCalledWe decided to drop onResolverCalled hook and instead
provide a new plugin that will let you hook into
this phase.import { parse, validate, execute, subscribe } from 'graphql' import { envelop, Plugin, useEngine } from '@envelop/core' + import { useOnResolve } from '@envelop/on-resolve' import { onResolverCalled } from './my-resolver' function useResolve(): Plugin { return { - onResolverCalled: onResolverCalled, + onPluginInit: ({ addPlugin }) => { + addPlugin(useOnResolve(onResolverCalled)) + }, } } const getEnveloped = envelop({ plugins: [ useEngine({ parse, validate, execute, subscribe }), // ... other plugins ... useResolve(), ], }); - Breaking
#1487
dc1e24b5
Thanks @saihaj! - DropuseTimingpluginThis plugin was dependent on tracing the schema. As we no longer support wrap the schema out of
the box we decided to drop this plugin. - Breaking
#1487
dc1e24b5
Thanks @saihaj! - RemoveisIntrospectionDocumentutility - Breaking
#1487
dc1e24b5
Thanks @saihaj! - Drop Node v12 supportNode.js v12 is no longer supported by the Node.js team.
github.com/nodejs/Release/ - Breaking
#1487
dc1e24b5
Thanks @saihaj! - DropEnvelopErrorclassTo keep the core agnostic from a specific implementation we no longer provide the
EnvelopError
class. - Breaking
#1487
dc1e24b5
Thanks @saihaj! - RemoveuseAsyncSchemapluginThis was a mistake from beginning as we cannot asynchronously validate and parse since with
graphql these functions are synchronous in nature. - Breaking
#1487
dc1e24b5
Thanks @saihaj! - Removegraphqlas a peer dependencyWe have built the new
envelopto be engine agnostic.graphql-jsis no longer a peer
dependency. Now you can use any spec compliant GraphQL engine withenvelopand get the benefit
of building a plugin system. We have introduced a new plugin that can be used to customize the
GraphQL Engine.- import { envelop } from '@envelop/core' + import { envelop, useEngine } from '@envelop/core' + import { parse, validate, execute, subscribe } from 'graphql'; - const getEnveloped = envelop([ ... ]) + const getEnveloped = envelop({ plugins: [useEngine({ parse, validate, execute, subscribe })] })Checkout the
migration guide for
more details. - Breaking
#1487
dc1e24b5
Thanks @saihaj! - RenameuseLazyLoadedSchematouseSchemaByContextsince the original name was vert misleading. - Breaking
#1487
dc1e24b5
Thanks @saihaj! - RemoveenableIfutility in favor of more type
safe way to conditionally enable plugins. It wasn't a great experience to have a utilityWe can easily replace usage like this:
- import { envelop, useMaskedErrors, enableIf } from '@envelop/core' + import { envelop, useMaskedErrors } from '@envelop/core' import { parse, validate, execute, subscribe } from 'graphql' const isProd = process.env.NODE_ENV === 'production' const getEnveloped = envelop({ parse, validate, execute, subscribe, plugins: [ // This plugin is enabled only in production - enableIf(isProd, useMaskedErrors()) + isProd && useMaskedErrors() ] }) - Breaking
#1487
dc1e24b5
Thanks @saihaj! - RemovehandleValidationErrorsandhandleParseErrorsoptions fromuseMaskedErrors.ONLY masking validation errors OR ONLY disabling introspection errors does not make sense, as
both can be abused for reverse-engineering the GraphQL schema (see
github.com/nikitastupin/clairvoyance for reverse-engineering the schema based on
validation error suggestions). #1482Rename
formatErrorfunction option tomaskError - Breaking
#1487
dc1e24b5
Thanks @saihaj! - Removed orchestrator tracingGraphQLSchemawas wrapped to provide resolvers/fields tracing from the schema. Issue with this
approach was it was very specific to the underlying engine's implementation. With the new version
we no longer want to depend to a specific implementation. Now users can wrap their schemas and add
tracing themselves.
Minor Changes
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.