@graphql-tools/utils
13.2.2 · 10 Nov 2026MIT57M / weekRepositoryHomepagenpmAtom feed
13.2.2 is the newest release of 13.x.
In short
2 fixed
Release note
The section about @graphql-tools/utils of a note shared by several packages.
Patch Changes
mapSchemanow 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.
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.