@graphql-tools/utils
13.1.3 · 22 Oct 2026MIT25.7M / weekRepositoryHomepagenpmAtom feed
Latest releases
All 186 releases- 13.x · latest line
13.1.3
22 Oct 2026mapSchemanow remaps directive argument defaults the same way it already remaps field argument defaults.Use case:
UserRoleis remapped to internal ids, and@authdefaults toUSER.const schema = mapSchema(originalSchema, { [MapperKind.ENUM_VALUE]: (valueConfig, typeName, _schema, externalValue) => { if (typeName === 'UserRole' && externalValue === 'USER') { return { ...valueConfig, value: '3user' }; } return valueConfig; }, }); // directive @auth(role: UserRole = USER) schema.getDirective('auth').args.find(arg => arg.name === 'role').defaultValue; // before: "USER" // after: "3user"mapSchemaserializes the stored default with the source type before parsing with the remapped type, so an internal value that matches another enum name (USER->"ADMIN") stays"ADMIN"instead of being parsed as that name.forEachDefaultValuewalks directive arguments too, somakeExecutableSchemaenum resolvers get the same result.Published
Executortypes include/// <reference lib="esnext.disposable" preserve="true" />so consumers do not needskipLibCheckor a fullesnextlib just to import this package.Use case: an app with
"lib": ["es2022"]or["es2024"]andskipLibCheck: falsethat imports@graphql-tools/utils:import type { Executor } from '@graphql-tools/utils'; export const executor: Executor = async request => { // ... };Executorcan return aDisposable/AsyncIterableresult. Those names live in TypeScript'sesnext.disposablelib, which is not part ofes2022/es2024. Without the preserved reference,tscreportsCannot find name 'Disposable'. With it, the published.d.tspulls in that lib for the consumer automatically.
13.1.2
22 Oct 2026printSchemaWithDirectivesno longer turns unquoted directive argument literals into strings.In GraphQL SDL, an unquoted identifier in value position is an
EnumValueAST node. A quoted value is aStringValue. Those are different kinds even when the argument type is a custom scalar rather than anenumtype.parseLiteralon that scalar receives the original kind, so a custom scalar can treatargument_valueand"argument_value"as different inputs.The printer was reconstructing directive arguments from JS values.
valueFromASTUntypedmaps both kinds to the same string, andastFromValuethen emits aStringValue. The printed SDL became@directive(arg: "argument_value")even though the schema AST still had@directive(arg: argument_value).That is a round-trip / fidelity bug: loaders, schema diffs, snapshots, and subgraph publishes see different SDL, and a scalar that distinguishes the two kinds changes meaning. Default scalars coerce both to the same JS string, so many runtime paths do not notice.
When the original AST is still the source of truth,
printSchemaWithDirectivesnow keeps those directive argument nodes, including nested list and input-object values. If directive values are supplied only through extensions (code-first), JS strings are still printed as strings because the original kind is not available.Fixes #8557
13.1.1
20 Oct 2026INCREMENTAL_DELIVERY_SPECSis the shared HTTP contract forincrementalSpec. Each row maps an Accept / Content-Type parameter (deferSpec=20220824,incrementalSpec=v0.2, ...) to the executor payload id ('v0.1'|'v0.2').GraphQL Yoga, Hive Gateway, HTTP executors, and other servers should look up this table instead of hardcoding spec strings. When a later incremental spec ships, the work stays in graphql-tools: add a row here and an executor publisher. Consumers bump
@graphql-tools/utils/@graphql-tools/executor. Accept negotiation, Content-Type echo, and 406 for unknown spec params keep working without a Yoga / Gateway / executor-http patch for the new identifier.Unknown values for a registered parameter name stay unsupported (HTTP 406). Helpers:
lookupIncrementalDeliverySpec,getMultipartContentType,getDefaultIncrementalDeliverySpec,getIncrementalSpecParameterNames.
13.1.0
20 Oct 2026@graphql-tools/executorcan publish both incremental delivery payload formats from one execution kernel. PassincrementalSpec: 'v0.1' | 'v0.2'onexecute/subscribe/normalizedExecutor(also onExecutionRequestforexecutorFromSchema).'v0.1'remains the default and keeps the existingpath/labelpatches used withmultipart/mixed;deferSpec=20220824.'v0.2'emits Apollo incremental v0.2 payloads (pendingwithidandpath,incrementalwithidand optionalsubPath,completed) used withmultipart/mixed;incrementalSpec=v0.2.Field execution,
@defer/@streamscheduling, andAbortSignalcancellation are shared. Spec-specific JSON is built by a publisher: v0.1 still yields{ incremental, hasNext }; v0.2 assigns ids when a pending group is first announced, groups streamed items under one pending path, and reports completion separately. Nested@deferpatches are collected as children of the parent patch so v0.2 can announce the inner fragment only after the parent is pending, without making the nested fragment wait on the parent's promise (v0.1 sibling completion is unchanged aside from incremental array order).Publisher state (
Map/Setof ids) is allocated only for'v0.2'.StreamGroupis created only for v0.2 and only when items are actually streamed. v0.2 stream completion uses an open-count on the group instead of scanningsubsequentPayloads.mergeIncrementalResultstill merges v0.1path/itemspatches. For v0.2 it recordspendingids on the execution result, writes deferreddataatpending.path + subPath, appends streameditemsonto the list atpending.path, and foldscompleted.errorsintoerrors.visitResultflattens nested deferred patches so result visiting still sees fields that live under a child@defer.
13.0.2
19 Oct 2026Add
asGetArgumentValuesVariablesandcoerceGetVariableValuesResulthelpers for GraphQL 16/17VariableValuescompatibility when callinggetArgumentValues/ normalizinggetVariableValuesresults for helpers likeshouldIncludeNode.
Dependency tracking · free for 3 projects
Know when your own dependencies move
@graphql-tools/utils had 2 security advisories in the last 12 months. Inlinr emails you the day one touches a project of yours, with the version that fixes it.
Advisories reach you
An email when a critical or high advisory affects a project, before the next install.
Upgrades checked first
Peer ranges, Node, ESM-only and types changes read before you bump.
Only what matters
Majors and breaking notes stay; patches and sibling bumps fold into one line.
Registry facts last checked 24 Oct 2026. Releases and advisories last read 24 Oct 2026.