On this page

@envelop/on-resolve

Changelog for @envelop/on-resolve: every release with its changes and the pull requests behind them.

8.0.0

Major Changes

  • #4574 79b0e8b Thanks @egoodwinx! - ### Breaking Changes

    • Node: minimum supported version is now Node 22. Node 18 and 20 are no longer supported. Future releases will only support Node >=22.
    • GraphQL: minimum supported version is now GraphQL 16. GraphQL 14 and 15 are no longer supported.
    • Request body parsing: Yoga now limits request bodies to 25,000,000 bytes by default. Enforcing this limit streams the body through a byte counter, making POST body parsing asynchronous even for an in-memory body. As a result, yoga.fetch() can return a Promise where it previously returned a synchronous Response, even when all resolvers and plugins are synchronous.

    Migration

    • If you’re on Node 18/20, upgrade to Node 22 or later before upgrading this package.
    • If you’re on graphql 14/15, upgrade to graphql 16 or 17 first.
    • Await yoga.fetch() and response body parsing instead of relying on synchronous results. Set maxRequestBodySize: false in createYoga to disable the body-size limit and preserve synchronous parsing for in-memory bodies, but only if you enforce an appropriate request-body limit elsewhere.
  • #4574 79b0e8b Thanks @egoodwinx! - ### Dependencies

    • Bump @whatwg-node/server to ^0.13.0, @whatwg-node/fetch to ^0.12.0, and @whatwg-node/promise-helpers to ^2.0.0.
    • Delegate to @whatwg-node/server’s useLimitRequestBodySize instead of a hand-rolled byte counter, and swap in the native TransformStream when the incoming request already has a native ReadableStream body — piping it through the ponyfill TransformStream throws since they’re different realms. Thread an optional fetchAPI param through handle/parseRequest/ getResultForParams so callers can override which fetchAPI (native vs ponyfill) the rest of the pipeline uses.
    • Unread request bodies are discarded after the response is decided (keep-alive friendly).
    • Incoming global Request instances automatically use the native Fetch API (pickRightFetchAPI), so Next.js no longer needs fetchAPI: { Response }.

    Breaking Changes

    • engines.node is now >=22.15.0 (aligned with whatwg-node 0.12+/0.13).
    • @envelop/core no longer exports mapMaybePromise (removed upstream in @whatwg-node/promise-helpers v2). Use handleMaybePromise(() => value, ...) instead.
    • @whatwg-node/fetch no longer exports crypto; use the platform crypto global. TextEncoder still comes from fetchAPI where hashing goes through Yoga’s FetchAPI.

Patch Changes

7.2.1

Patch Changes

7.2.0

Minor Changes

  • #4545 94ebe5b Thanks @egoodwinx! - Update to support graphql-js 17

    Bump package versions, fix expected typing, and update compatability with subscribe.

Patch Changes

  • Updated dependencies [94ebe5b]:
    • @envelop/core@5.6.0

7.1.1

Patch Changes

  • Updated dependencies [0bfde27]:
    • @envelop/core@5.5.1

7.1.0

Minor Changes

  • #2747 49346b2 Thanks @cecchi! - Add option to ignore default resolvers in opentelemetry instrumentation

    To reduce telemetry data volume and noise in traces, it is recommended to ignore resolvers with the default implementation since they probably doesn’t do anything worth tracking.

    Usage

    import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
    import { envelop, useEngine } from '@envelop/core'
    import { useOpenTelemetry } from '@envelop/opentelemetry'
    
    const getEnveloped = envelop({
      plugins: [
        useEngine({ parse, validate, specifiedRules, execute, subscribe }),
        // ... other plugins ...
    
        useOpenTelemetry({
          resolvers: true,
          defaultResolvers: false // explicitly disable default resolvers tracing. Defaults to `true`
        })
      ]
    })

Patch Changes

  • Updated dependencies [d3d83bc]:
    • @envelop/core@5.5.0

7.0.0

Patch Changes

  • Updated dependencies [0434fbd]:
    • @envelop/core@5.4.0

6.0.0

Patch Changes

  • Updated dependencies [3ebaa3b]:
    • @envelop/core@5.3.0

5.1.3

Patch Changes

5.1.2

Patch Changes

5.1.1

Patch Changes

5.1.0

Patch Changes

5.0.1

Patch Changes

5.0.0

Patch Changes

  • Updated dependencies [9bd1b20]:
    • @envelop/core@5.1.0

4.1.1

Patch Changes

  • #2292 c3dd2c3 Thanks @ardatan! - Refactor the plugin to avoid extra promises with `mapMaybePromise`

  • Updated dependencies [c3dd2c3]:

    • @envelop/core@5.0.2

4.1.0

Minor Changes

4.0.0

Major Changes

3.0.3

Patch Changes

3.0.2

Patch Changes

  • Updated dependencies [db20864a]:
    • @envelop/core@4.0.2

3.0.1

Patch Changes

  • Updated dependencies []:
    • @envelop/core@4.0.1

3.0.0

Major Changes

Patch Changes

2.0.6

Patch Changes

  • Updated dependencies [c1eb2c09]:
    • @envelop/core@3.0.6

2.0.5

Patch Changes

  • Updated dependencies [270249cf]:
    • @envelop/core@3.0.5

2.0.4

Patch Changes

  • Updated dependencies []:
    • @envelop/core@3.0.4

2.0.3

Patch Changes

  • Updated dependencies [6b48ef96]:
    • @envelop/core@3.0.3

2.0.2

Patch Changes

  • Updated dependencies [22f5ccfb]:
    • @envelop/core@3.0.2

2.0.0

Major Changes

  • #1487 dc1e24b5 Thanks @saihaj! - Remove onResolverCalled

    We 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(),
      ],
    });
  • Updated dependencies [dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5, dc1e24b5]:

    • @envelop/core@3.0.0