Skip to Content
GraphQL Tools

@graphql-tools/merge

10.0.1

Patch Changes

  • Updated dependencies [15efe55]:
    • @graphql-tools/utils@13.0.1

10.0.0

Major Changes

  • #8515  1d70c62 Thanks @ardatan ! - Drop GraphQL v14/v15 support and require Node.js >= 22.18.

    • graphql peer range is now ^16.0.0 || ^17.0.0.
    • engines.node is now >=22.18.0 (Node fs.glob + Babel 8).
    • Dev tooling and @graphql-tools/graphql-tag-pluck move to Babel 8 (@babel/core / parser / traverse / types).
    • The standalone cross-inspect package is discontinued. Use inspect from @graphql-tools/utils instead (Node util.inspect via process.getBuiltinModule, with a small JSON.stringify / String fallback).

    Removed @graphql-tools/utils exports

    RemovedUse instead
    getArgumentValuesimport { getArgumentValues } from 'graphql'
    coerceInputs / graphqlJSCompatgraphql@16+ APIs (getArgumentValues, etc.)
    createDeferred / createDeferredPromiseconst { promise, resolve, reject } = Promise.withResolvers()
    createGraphQLErrornew GraphQLError(message, options) from graphql
    mapMaybePromisehandleMaybePromise from @whatwg-node/promise-helpers
    isPromise / fakePromise / mapAsyncIterator / MaybePromise@whatwg-node/promise-helpers
    registerAbortSignalListener / getAbortPromiseAbortSignal APIs (throwIfAborted, addEventListener('abort', …, { once: true }), AbortSignal.any, …)
    withCancel / getAsyncIterableWithCancel / getAsyncIteratorWithCancelHandle cancellation on the async iterator’s return() (or your transport abort path)
    debugTimerStart / debugTimerEndYour own timing / console.time if needed
    PromiseWithResolvers (type)Built-in PromiseWithResolvers<T> / return type of Promise.withResolvers()

    inspect and the WeakMap memoize1…memoize2of5 helpers remain on @graphql-tools/utils (inspect is no longer re-exported from cross-inspect).

    File matching (globby → fs.glob)

    Loaders and @graphql-tools/load-files now use Node’s fs.glob through:

    import { matchFiles, matchFilesSync } from '@graphql-tools/load-files';

    Directory symlinks are followed for recursive (**) patterns:

    • On Node.js ≥26.1 (and ≥24.16 where backported), fs.glob followSymlinks is used.
    • On older engines, symlink directories are discovered only under each pattern’s literal prefix (not the whole cwd) and patterns are re-rooted.
    • Non-recursive / literal patterns skip the symlink walk entirely.

    @graphql-tools/executor hot-path caches (collectSubfields, argument coercion, @stream detection) use memoize2 / memoize3 from utils. collectSubFields in utils stays unmemoized so the executor can own a single memoize3 layer.

    Errors and other cleanup

    • Prefer new GraphQLError(message, options) from graphql. Experimental schema coordinate support remains on locatedError / relocatedError / getSchemaCoordinate.
    • Removed GraphQL versions older than 16 compatibility branches (error construction, validation rule name suffixes, URL.canParse fallback).
    • Promise helpers should be imported from @whatwg-node/promise-helpers (handleMaybePromise, isPromise, fakePromise, mapAsyncIterator, MaybePromise) rather than re-exported from utils.

Patch Changes

9.2.8

Patch Changes

  • #8445  82457d1 Thanks @ardatan ! - dependencies updates:

  • #8445  82457d1 Thanks @ardatan ! - Fix: Preserve symbol-keyed GraphQL extensions when building, merging, or extracting schemas.

    GraphQL.js v17 allows string | symbol keys on schema/type/field extensions (via toObjMapWithSymbols). @graphql-tools was dropping those symbol keys in two places:

    1. mergeDeep only walked enumerable string keys (for...in), so symbol extensions were lost when applying schemaExtensions.
    2. extractExtensionsFromSchema did not copy non-enumerable own symbol keys (enumerable symbols already survive object rest/spread; the explicit loop covers the non-enumerable case).

    Example (bug)

    import { makeExecutableSchema } from '@graphql-tools/schema' const META = Symbol('META') const schema = makeExecutableSchema({ typeDefs: /* GraphQL */ ` type Query { hello: String } `, schemaExtensions: { schemaExtensions: { [META]: { source: 'app' }, tagged: true, }, types: {}, }, }) // Before: only string keys survived // schema.extensions === { tagged: true } // After: symbol keys are preserved // schema.extensions[META] === { source: 'app' } // schema.extensions.tagged === true

    Schema extension merge/extract and resolver merging always enable { enumerable: true, nonEnumerable: true } so symbol keys survive in tools’ own merge/extract paths on every supported GraphQL.js major. (GraphQL.js itself may still drop symbol keys from field configs below v17 when rebuilding types.)

    mergeDeep API

    mergeDeep now accepts an options object. The old positional boolean arguments still work but are deprecated.

    import { mergeDeep } from '@graphql-tools/utils' // Deprecated (still supported) mergeDeep([a, b], false, true, false, true) // ^proto ^arrays ^len ^non-enumerable symbols only // Preferred mergeDeep([a, b], { respectPrototype: false, respectArrays: true, respectArrayLength: false, respectSymbols: { enumerable: true, // merge `obj[sym] = value` keys nonEnumerable: true, // copy defineProperty(..., { enumerable: false }) symbols }, })

    respectSymbols defaults to { enumerable: false, nonEnumerable: false } (symbols dropped), matching the historical default. The legacy 5th positional flag still maps to { nonEnumerable: true } only.

    Resolver map types (IResolvers / field resolver extensions and type __extensions) now use ExtensionsObject (Record<string | symbol, any>), so symbol-keyed resolver extensions type-check under GraphQL.js v17+.

  • Updated dependencies [98673c3, a75d725, 82457d1]:

    • @graphql-tools/utils@12.1.0

9.2.7

Patch Changes

  • Updated dependencies [fd95dc9]:
    • @graphql-tools/utils@12.0.4

9.2.6

Patch Changes

  • Updated dependencies [19f5b33]:
    • @graphql-tools/utils@12.0.3

9.2.5

Patch Changes

  • #8467  20d36a5 Thanks @ardatan ! - Fix prototype pollution in mergeIncrementalResult

    Path segments are now rejected unless they are primitive strings or numbers, and keys named __proto__, constructor or prototype are still blocked. Previously a non-primitive segment such as ["__proto__"] bypassed the string equality guard and was coerced into a write on Object.prototype.

    Also exports shared isSafeObjectKey / isDangerousObjectKey helpers used by this path walker and other package call sites. @graphql-tools/merge and @graphql-tools/mock are patched so they ship with the new imports; updateInternalDependencies raises their utils floor when 12.0.2 is versioned.

  • Updated dependencies [b1fbba2, 20d36a5]:

    • @graphql-tools/utils@12.0.2

9.2.4

Patch Changes

  • #8367  2262087 Thanks @ardatan ! - Preserve multiple applications of the same directive when extending a type even if the repeatable directive definition is not present in the merge inputs.

  • #8394  5523c4b Thanks @bengry ! - Write the synthesized default operation types back onto the schema definition node, so merging a schema extension that has no operation block (federation SDL, for example) still produces a query root on graphql@17.

  • Updated dependencies [60db079, 57e316d, 1c1c5a0, 1c1c5a0, 0b9529f]:

    • @graphql-tools/utils@12.0.1

9.2.3

Patch Changes

  • #8349  7fe0319 Thanks @aarne ! - Pass the collected directive definitions to mergeSchemaDefs so repeatable directives on schema definitions and extend schema extensions (e.g. a repeatable @link) are kept as separate instances instead of being collapsed and having their arguments merged.

  • Updated dependencies [2273c21]:

    • @graphql-tools/utils@12.0.0

9.2.2

Patch Changes

  • Updated dependencies [e90719b]:
    • @graphql-tools/utils@11.2.2

9.2.1

Patch Changes

  • Updated dependencies [615c1a2]:
    • @graphql-tools/utils@11.2.1

9.2.0

Minor Changes

9.1.11

Patch Changes

  • Updated dependencies [2609c94]:
    • @graphql-tools/utils@11.2.0

9.1.10

Patch Changes

  • Updated dependencies [981d461]:
    • @graphql-tools/utils@11.1.1

9.1.9

Patch Changes

  • Updated dependencies [a4b7dce]:
    • @graphql-tools/utils@11.1.0

9.1.8

Patch Changes

  • Updated dependencies [ae36a0e]:
    • @graphql-tools/utils@11.0.1

9.1.7

Patch Changes

  • Updated dependencies [6f3776c]:
    • @graphql-tools/utils@11.0.0

9.1.6

Patch Changes

  • Updated dependencies [2118a80]:
    • @graphql-tools/utils@10.11.0

9.1.5

Patch Changes

  • Updated dependencies [2fe123a]:
    • @graphql-tools/utils@10.10.3

9.1.4

Patch Changes

  • Updated dependencies [dddc5f6]:
    • @graphql-tools/utils@10.10.2

9.1.3

Patch Changes

  • Updated dependencies [fbb58b5]:
    • @graphql-tools/utils@10.10.1

9.1.2

Patch Changes

9.1.1

Patch Changes

9.1.0

Minor Changes

  • #7249  e5f98c2 Thanks @jdolle ! - Support repeatable @link-ed federation directives; fix merging non-identical, repeatable directives

Patch Changes

9.0.24

Patch Changes

  • Updated dependencies [d123e26]:
    • @graphql-tools/utils@10.8.6

9.0.23

Patch Changes

9.0.22

Patch Changes

  • Updated dependencies [155944b]:
    • @graphql-tools/utils@10.8.4

9.0.21

Patch Changes

  • Updated dependencies [4a2eb14]:
    • @graphql-tools/utils@10.8.3

9.0.20

Patch Changes

  • Updated dependencies [3547bba]:
    • @graphql-tools/utils@10.8.2

9.0.19

Patch Changes

  • Updated dependencies [651a5dc]:
    • @graphql-tools/utils@10.8.1

9.0.18

Patch Changes

  • Updated dependencies [0a3e193, 357b2ee]:
    • @graphql-tools/utils@10.8.0

9.0.17

Patch Changes

  • Updated dependencies [53bb601, 53bb601]:
    • @graphql-tools/utils@10.7.2

9.0.16

Patch Changes

  • Updated dependencies [4912f19]:
    • @graphql-tools/utils@10.7.1

9.0.15

Patch Changes

  • Updated dependencies [2c70d27]:
    • @graphql-tools/utils@10.7.0

9.0.14

Patch Changes

  • Updated dependencies [6a8123b]:
    • @graphql-tools/utils@10.6.4

9.0.13

Patch Changes

  • Updated dependencies [020b9e4]:
    • @graphql-tools/utils@10.6.3

9.0.12

Patch Changes

9.0.11

Patch Changes

  • Updated dependencies [1e02935]:
    • @graphql-tools/utils@10.6.1

9.0.10

Patch Changes

  • Updated dependencies [414e404]:
    • @graphql-tools/utils@10.6.0

9.0.9

Patch Changes

  • Updated dependencies [dc5043b]:
    • @graphql-tools/utils@10.5.6

9.0.8

Patch Changes

  • Updated dependencies [cf2ce5e]:
    • @graphql-tools/utils@10.5.5

9.0.7

Patch Changes

9.0.6

Patch Changes

9.0.5

Patch Changes

  • b8bf584 Thanks @ardatan ! - Introduce `getDirectiveExtensions` and refactor directive handling in the extensions

  • Updated dependencies [b8bf584]:

    • @graphql-tools/utils@10.4.0

9.0.4

Patch Changes

9.0.3

Patch Changes

9.0.2

Patch Changes

9.0.1

Patch Changes

  • a570a601 Thanks @ardatan ! - Add respectArrays flag to extensions merging

  • Updated dependencies [a570a601]:

    • @graphql-tools/utils@10.0.10

9.0.0

Major Changes

Patch Changes

8.4.2

Patch Changes

8.4.1

Patch Changes

8.4.0

Minor Changes

  • #5075  04e3ecb9 Thanks @simplecommerce ! - Added onFieldTypeConflict option to handle manual conflicts for mergeTypeDef and reverseArguments option to select left side arguments if specified.

8.3.18

Patch Changes

  • Updated dependencies [b5c8f640]:
    • @graphql-tools/utils@9.2.1

8.3.17

Patch Changes

8.3.16

Patch Changes

8.3.15

Patch Changes

  • Updated dependencies [e3ec35ed]:
    • @graphql-tools/utils@9.1.4

8.3.14

Patch Changes

  • Updated dependencies [904fe770]:
    • @graphql-tools/utils@9.1.3

8.3.13

Patch Changes

  • Updated dependencies [13c24883]:
    • @graphql-tools/utils@9.1.2

8.3.12

Patch Changes

  • Updated dependencies [7411a5e7]:
    • @graphql-tools/utils@9.1.1

8.3.11

Patch Changes

  • Updated dependencies [c0639dd0]:
    • @graphql-tools/utils@9.1.0

8.3.10

Patch Changes

  • Updated dependencies [d83b1960]:
    • @graphql-tools/utils@9.0.1

8.3.9

Patch Changes

8.3.8

Patch Changes

  • Updated dependencies [f7daf777]:
    • @graphql-tools/utils@8.13.1

8.3.7

Patch Changes

8.3.6

Patch Changes

  • Updated dependencies [43c736bd]:
    • @graphql-tools/utils@8.12.0

8.3.5

Patch Changes

8.3.4

Patch Changes

  • Updated dependencies [4fe3d9c0]:
    • @graphql-tools/utils@8.10.1

8.3.3

Patch Changes

8.3.2

Patch Changes

  • #4624  e3167edc Thanks @n1ru4l ! - Fix CommonJS TypeScript resolution with moduleResolution node16 or nodenext

  • Updated dependencies [e3167edc]:

    • @graphql-tools/utils@8.9.1

8.3.1

Patch Changes

  • Updated dependencies [2a3b45e3]
    • @graphql-tools/utils@8.9.0

8.3.0

Minor Changes

  • d76a299c: Support TypeScript module resolution.

Patch Changes

  • Updated dependencies [a0abbbcd]
  • Updated dependencies [d76a299c]
    • @graphql-tools/utils@8.8.0

8.2.15

Patch Changes

  • Updated dependencies [4914970b]
    • @graphql-tools/utils@8.7.0

8.2.14

Patch Changes

  • 041c5ba1: Use caret range for the tslib dependency
  • Updated dependencies [041c5ba1]
    • @graphql-tools/utils@8.6.13

8.2.13

Patch Changes

  • Updated dependencies [da7ad43b]
    • @graphql-tools/utils@8.6.12

8.2.12

Patch Changes

  • Updated dependencies [c0762ee3]
    • @graphql-tools/utils@8.6.11

8.2.11

Patch Changes

  • Updated dependencies [0fc510cb]
    • @graphql-tools/utils@8.6.10

8.2.10

Patch Changes

  • Updated dependencies [31a33e2b]
    • @graphql-tools/utils@8.6.9

8.2.9

Patch Changes

  • Updated dependencies [cb238877]
    • @graphql-tools/utils@8.6.8

8.2.8

Patch Changes

  • Updated dependencies [0bbb1769]
    • @graphql-tools/utils@8.6.7

8.2.7

Patch Changes

  • Updated dependencies [904c0847]
    • @graphql-tools/utils@8.6.6

8.2.6

Patch Changes

  • Updated dependencies [be2c02d7]
    • @graphql-tools/utils@8.6.5

8.2.5

Patch Changes

  • Updated dependencies [d36d530b]
    • @graphql-tools/utils@8.6.4

8.2.4

Patch Changes

  • 0c0c6857: fix - align versions

8.2.3

Patch Changes

  • 18341363: feat(visitResult): ignore if field not present in visited object
  • Updated dependencies [18341363]
    • @graphql-tools/utils@8.6.2

8.2.2

Patch Changes

  • 12691405: Update mergeTypeDefs to merge implements definitions defined within interface extensions.

8.2.1

Patch Changes

  • 4bfb3428: enhance: use ^ for tslib dependency
  • Updated dependencies [4bfb3428]
    • @graphql-tools/utils@8.5.1

8.2.0

Minor Changes

  • 149afddb: fix: getting ready for GraphQL v16

Patch Changes

  • Updated dependencies [149afddb]
    • @graphql-tools/utils@8.4.0

8.1.2

Patch Changes

  • 9a005161: fix(merge): convertExtensions should convert extensions to regular definitions not other way around

8.1.1

Patch Changes

  • d4918a78: fix(commentDescriptions): handle descriptions and comments correctly during merge
  • Updated dependencies [d4918a78]
    • @graphql-tools/utils@8.2.2

8.1.0

Minor Changes

  • c5b0719c: feat: GraphQL v16 support

Patch Changes

  • Updated dependencies [c5b0719c]
  • Updated dependencies [c5b0719c]
  • Updated dependencies [c5b0719c]
  • Updated dependencies [c5b0719c]
  • Updated dependencies [c5b0719c]
    • @graphql-tools/utils@8.2.0

8.0.3

Patch Changes

  • c8c13ed1: enhance: remove TypeMap and small improvements
  • Updated dependencies [c8c13ed1]
    • @graphql-tools/utils@8.1.2

8.0.2

Patch Changes

  • e50852e6: use version ranges instead of a fixed version for the graphql-tools package versions

8.0.1

Patch Changes

  • Updated dependencies [2c807ddb]
    • @graphql-tools/utils@8.1.1

8.0.0

Major Changes

  • 67691b78: - schemaExtensions option has been added to mergeSchemas, makeExecutableSchema and stitchSchemas configurations

    Breaking Changes;

    • Move mergeSchemas and MergeSchemasConfig from @graphql-tools/merge to @graphql-tools/schema package to prevent circular dependency between them.
    • mergeSchemasAsync has been removed.
    • Move NamedDefinitionNode, resetComments, collectComment, pushComment and printComment from @graphql-tools/merge to @graphql-tools/utils.

Patch Changes

  • a5fb77a4: fix(merge): ignore comments while merging directives #3031
  • Updated dependencies [b9684631]
  • Updated dependencies [9ede806a]
  • Updated dependencies [67691b78]
    • @graphql-tools/utils@8.1.0

7.0.0

Major Changes

  • 4992b472: BREAKING: change type signature and generic parameters of mergeResolvers

Patch Changes

  • @graphql-tools/schema@8.0.3

6.2.17

Patch Changes

  • Updated dependencies [04830049]
    • @graphql-tools/utils@8.0.2
    • @graphql-tools/schema@8.0.2

6.2.16

Patch Changes

  • Updated dependencies [b823dbaf]
    • @graphql-tools/utils@8.0.1
    • @graphql-tools/schema@8.0.1

6.2.15

Patch Changes

  • a31f9593: fix(merge): handle schema definitions correctly
  • Updated dependencies [af9a78de]
  • Updated dependencies [9c26b847]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [dae6dc7b]
  • Updated dependencies [6877b913]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [c42e811d]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [8c8d4fc0]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [74581cf3]
  • Updated dependencies [c0ca3190]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [982c8f53]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [7d3e3006]
  • Updated dependencies [7d3e3006]
    • @graphql-tools/utils@8.0.0
    • @graphql-tools/schema@8.0.0

6.2.14

Patch Changes

  • eae28793: fix(merge): handle undefined interfaces array on ObjectTypeDefinitionNode #2629

6.2.13

Patch Changes

  • 60a9c9a5: fix(merge): handle arrays correctly

6.2.12

Patch Changes

  • 68946667: fix(merge): fix handling schema definitions with convertExtensions flag

6.2.11

Patch Changes

  • 43da6b59: enhance(merge): reduce number of iterations
  • Updated dependencies [58fd4b28]
  • Updated dependencies [43da6b59]
    • @graphql-tools/utils@7.7.0

6.2.10

Patch Changes

  • 0194118f: Introduces a suite of stitched schema validations that enforce the integrity of merged schemas. This includes validations for:

    • Strict and safe null consistency (the later of which allows safe transitions in nullability).
    • Named type consistency with the option to whitelist proxiable scalar mappings.
    • Argument and input field name consistency.
    • Enum value consistency when used as an input value.

    Validations may be adjusted by setting validationLevel to off|warn|error globally or scoped for specific types and fields. In this initial v7 release, all validations are introduced at the warn threshold for backwards compatibility. Most of these validations will become automatic errors in v8. To enable validation errors now, set validationLevel: 'error'. Full configuration options look like this:

    const gatewaySchema = stitchSchemas({ subschemas: [...], typeMergingOptions: { validationSettings: { validationLevel: 'error', strictNullComparison: false, // << gateway "String" may proxy subschema "String!" proxiableScalars: { ID: ['String'], // << gateway "ID" may proxy subschema "String" } }, validationScopes: { // scope to specific element paths 'User.id': { validationLevel: 'warn', strictNullComparison: true, }, } }, });

6.2.9

Patch Changes

  • 219ed392: enhance(load/module-loader/merge): use getDocumentNodeFromSchema instead of parse and printSchemaWithDirectives together
  • Updated dependencies [219ed392]
  • Updated dependencies [219ed392]
  • Updated dependencies [219ed392]
    • @graphql-tools/utils@7.5.0

6.2.8

Patch Changes

  • 8f331aaa: enhance(load/module-loader/merge): use getDocumentNodeFromSchema instead of parse and printSchemaWithDirectives together
  • Updated dependencies [8f331aaa]
  • Updated dependencies [8f331aaa]
    • @graphql-tools/utils@7.4.0

6.2.7

Patch Changes

  • d9b82a2e: fix(merge/stitch) consistent enum value merge
  • d9b82a2e: enhance(stitch) canonical merged type and field definitions. Use the @canonical directive to promote preferred type and field descriptions into the combined gateway schema.

6.2.6

Patch Changes

  • 878c36b6: enhance(stitch): use mergeScalar from merge

6.2.5

Patch Changes

  • be1a1575: ## Breaking Changes:

    Schema Generation and Decoration API (@graphql-tools/schema)

    • Resolver validation options should now be set to error, warn or ignore rather than true or false. In previous versions, some of the validators caused errors to be thrown, while some issued warnings. This changes brings consistency to validator behavior.

    • The allowResolversNotInSchema has been renamed to requireResolversToMatchSchema, to harmonize the naming convention of all the validators. The default setting of requireResolversToMatchSchema is error, matching the previous behavior.

    Schema Delegation (delegateToSchema & @graphql-tools/delegate)

    • The delegateToSchema return value has matured and been formalized as an ExternalObject, in which all errors are integrated into the GraphQL response, preserving their initial path. Those advanced users accessing the result directly will note the change in error handling. This also allows for the deprecation of unnecessary helper functions including slicedError, getErrors, getErrorsByPathSegment functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The new getUnpathedErrors function is therefore necessary for retrieving only these errors. Note also the new annotateExternalObject and mergeExternalObjects functions, as well as the renaming of handleResult to resolveExternalValue.

    • Transform types and the applySchemaTransforms are now relocated to the delegate package; applyRequestTransforms/applyResultTransforms functions have been deprecated, however, as this functionality has been replaced since v6 by the Transformer abstraction.

    • The transformRequest/transformResult methods are now provided additional delegationContext and transformationContext arguments — these were introduced in v6, but previously optional.

    • The transformSchema method may wish to create additional delegating resolvers and so it is now provided the subschemaConfig and final (non-executable) transformedSchema parameters. As in v6, the transformSchema is kicked off once to produce the non-executable version, and then, if a wrapping schema is being generated, proxying resolvers are created with access to the (non-executable) initial result. In v7, the individual transformSchema methods also get access to the result of the first run, if necessary, they can create additional wrapping schema proxying resolvers.

    • applySchemaTransforms parameters have been updated to match and support the transformSchema parameters above.

    Remote Schemas & Wrapping (wrapSchema, makeRemoteExecutableSchema, and @graphql-tools/wrap)

    • wrapSchema and generateProxyingResolvers now only take a single options argument with named properties of type SubschemaConfig. The previously possible shorthand version with first argument consisting of a GraphQLSchema and second argument representing the transforms should be reworked as a SubschemaConfig object.

    • Similarly, the ICreateProxyingResolverOptions interface that provides the options for the createProxyingResolver property of SubschemaConfig options has been adjusted. The schema property previously could be set to a GraphQLSchema or a SubschemaConfig object. This property has been removed in favor of a subschemaConfig property that will always be a SubschemaConfig object. The transforms property has been removed; transforms should be included within the SubschemaConfig object.`

    • The format of the wrapping schema has solidified. All non-root fields are expected to use identical resolvers, either defaultMergedResolver or a custom equivalent, with root fields doing the hard work of proxying. Support for custom merged resolvers throught createMergedResolver has been deprecated, as custom merging resolvers conflicts when using stitching’s type merging, where resolvers are expected to be identical across subschemas.

    • The WrapFields transform’s wrappingResolver option has been removed, as this complicates multiple wrapping layers, as well as planned functionality to wrap subscription root fields in potentially multiple layers, as the wrapping resolvers may be different in different layers. Modifying resolvers can still be performed by use of an additional transform such as TransformRootFields or TransformObjectFields.

    • The ExtendSchema transform has been removed, as it is conceptually simpler just to use stitchSchemas with one subschema.

    • The ReplaceFieldsWithFragment, AddFragmentsByField, AddSelectionSetsByField, and AddMergedTypeSelectionSets transforms has been removed, as they are superseded by the AddSelectionSets and VisitSelectionSets transforms. The AddSelectionSets purposely takes parsed SDL rather than strings, to nudge end users to parse these strings at build time (when possible), rather than at runtime. Parsing of selection set strings can be performed using the parseSelectionSet function from @graphql-tools/utils.

    Schema Stitching (stitchSchemas & @graphql-tools/stitch)

    • stitchSchemas’s mergeTypes option is now true by default! This causes the onTypeConflict option to be ignored by default. To use onTypeConflict to select a specific type instead of simply merging, simply set mergeTypes to false.

    • schemas argument has been deprecated, use subschemas, typeDefs, or types, depending on what you are stitching.

    • When using batch delegation in type merging, the argsFromKeys function is now set only via the argsFromKeys property. Previously, if argsFromKeys was absent, it could be read from args.

    • Support for fragment hints has been removed in favor of selection set hints.

    • stitchSchemas now processes all GraphQLSchema and SubschemaConfig subschema input into new Subschema objects, handling schema config directives such aso@computed as well as generating the final transformed schema, stored as the transformedSchema property, if transforms are used. Signatures of the onTypeConflict, fieldConfigMerger, and inputFieldConfigMerger have been updated to include metadata related to the original and transformed subschemas. Note the property name change for onTypeConflict from schema to subschema.

    Mocking (addMocksToSchema and @graphql-tools/mock)

    • Mocks returning objects with fields set as functions are now operating according to upstream graphql-js convention, i.e. these functions take three arguments, args, context, and info with parent available as this rather than as the first argument.

    Other Utilities (@graphql-tools/utils)

    • filterSchema’s fieldFilter will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to the objectFieldFilter option.
    • Unused fieldNodes utility functions have been removed.
    • Unused typeContainsSelectionSet function has been removed, and typesContainSelectionSet has been moved to the stitch package.
    • Unnecessary Operation type has been removed in favor of OperationTypeNode from upstream graphql-js.
    • As above, applySchemaTransforms/applyRequestTransforms/applyResultTransforms have been removed from the utils package, as they are implemented elsewhere or no longer necessary.
    • proxy all the errors: #1047, #1641
    • better error handling for merges #2016, #2062
    • fix typings #1614
    • disable implicit schema pruning #1817
    • mocks not working for functions #1807
  • Updated dependencies [be1a1575]

    • @graphql-tools/schema@7.0.0
    • @graphql-tools/utils@7.0.0

6.2.4

Patch Changes

  • 32c3c4f8: Fix duplication of scalar directives in merge
  • 32c3c4f8: Support scalar extensions by merging directives
  • 533d6d53: Bump all packages to allow adjustments
  • Updated dependencies [32c3c4f8]
  • Updated dependencies [533d6d53]
    • @graphql-tools/utils@6.2.4
    • @graphql-tools/schema@6.2.4