Packages

@graphql-tools/wrap

11.2.6 · 12 Nov 2026MIT15.3M / weekRepositorynpmAtom feed

Your version

8.0.0

major28 Jul 2021Where it was published

8.5.1 is the newest release of 8.x.

In short

4 breaking1 internal

  • Breaking

    BREAKING CHANGE

  • Breaking

    ExecutionParams type replaced by Request type

  • Breaking

    BREAKING CHANGES;

  • Breaking

    getDirectives: Preserve order around repeatable directives

Release note

The section about @graphql-tools/wrap of a note shared by several packages.

Major Changes

  • Breaking

    BREAKING CHANGE

    • makeRemoteExecutableSchema has been removed.

    • You can use
      wrapSchema instead

  • Breaking

    ExecutionParams type replaced by Request type

    rootValue property is now a part of the Request type.

    When delegating with delegateToSchema, rootValue can be set multiple ways:

    • when using a custom executor, the custom executor can utilize a rootValue in whichever custom
      way it specifies.

    • when using the default executor (execute/subscribe from graphql-js): -- rootValue can be passed
      to delegateToSchema via a named option -- rootValue can be included within a subschemaConfig --
      otherwise, rootValue is inferred from the originating schema

    When using wrapSchema/stitchSchemas, a subschemaConfig can specify the createProxyingResolver
    function which can pass whatever rootValue it wants to delegateToSchema as above.

  • Breaking

    BREAKING CHANGES;

    • Rename Request to ExecutionRequest

    • Add required operationType: OperationTypeNode field in ExecutionRequest

    • Add context in createRequest and createRequestInfo instead of delegateToSchema

    It doesn't rely on info.operation.operationType to allow the user to call an operation from
    different root type. And it doesn't call getOperationAST again and again to get operation type
    from the document/operation because we have it in Request and ExecutionParams
    #3166

    Improvements;

    • Memoize defaultExecutor for a single GraphQLSchema so allow getBatchingExecutor to memoize
      batchingExecutor correctly.

    • And there is no different defaultExecutor is created for subscription and other operation
      types. Only one executor is used.

    Batch executor is memoized by executor reference but createDefaultExecutor didn't memoize
    the default executor so this memoization wasn't working correctly on batch-execute side.
    github.com/ardatan/graphql-tools/blob/remove-in…

  • Breaking

    BREAKING CHANGE

    • Now it uses the native
      AggregateError
      implementation. The major difference is the individual errors are kept under errors property
      instead of the object itself with Symbol.iterator.

    // From;
    for (const error of aggregateError)
    // To;
    for (const error of aggregateError.errors)
  • Breaking

    BREAKING CHANGE

    • Remove unnecessary introspectSchemaSync, introspectSchema already handles sync execution

  • Breaking

    getDirectives: Preserve order around repeatable directives

    BREAKING CHANGE: getDirectives now always return an array of individual DirectiveAnnotation
    objects consisting of name and args properties.

    New useful function getDirective returns an array of objects representing any args for each use
    of a single directive (returning the empty object {} when a directive is used without
    arguments).

    Note: The getDirective function returns an array even when the specified directive is
    non-repeatable. This is because one use of this function is to throw an error if more than one
    directive annotation is used for a non repeatable directive!

    When specifying directives in extensions, one can use either the old or new format.

  • Breaking

    BREAKING CHANGE

    • Remove Subscriber and use only Executor

    • Now Executor can receive AsyncIterable and subscriptions will also be handled by
      Executor. This is a future-proof change for defer, stream and live queries

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.