Skip to content

@nestjs/mercurius: accept graphql 17 now that mercurius supports it #4215

Open

Description

@varbSan

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

@nestjs/graphql and @nestjs/apollo accept graphql ^16 || ^17, but @nestjs/mercurius (14.1.2) still peers graphql ^16.10.0, so Mercurius users can't move to graphql 17 without overrides.

The range was kept at ^16 on purpose in 9ab7053 (#4034):

@nestjs/mercurius keeps its ^16 peer range: mercurius itself still calls buildExecutionContext, which v17 removed.

That no longer holds: mercurius 16.11.0 (mercurius-js/mercurius#1256) uses validateExecutionArgs on graphql 17, falls back to buildExecutionContext on 16, and declares graphql: ^16.0.0 || ^17.0.0.

Describe the solution you'd like

Widen packages/mercurius/package.json to "graphql": "^16.10.0 || ^17.0.0" and raise the mercurius peer floor to ^16.11.0, the first release that runs on graphql 17 (as #4190 did for the gateway).

Drawback: @mercuriusjs/gateway 5.2.0 and @mercuriusjs/federation 5.1.1 still depend on graphql ^16 directly, so federated setups stay on 16 until those move.

Happy to open the PR if that helps.

Teachability, documentation, adoption, migration strategy

No API change. Apps on graphql 16 are unaffected; apps on graphql 17 need mercurius >= 16.11.0.

What is the motivation / use case for changing the behavior?

We run @nestjs/graphql with the Mercurius driver and want to move to graphql 17; @nestjs/mercurius is the last Nest package holding it at 16.

Activity

  1. kamilmysliwiec commented on Nov 4, 2026

    @kamilmysliwiec
    Member

    Thanks, agreed: mercurius 16.11 removes the blocker we hit in #4034, so a PR is welcome. Please:

    • widen graphql to ^16.10.0 || ^17.0.0 and raise mercurius to ^16.11.0 in packages/mercurius/package.json
    • run the mercurius e2e suite against graphql 17, since CI runs on 16.14.2, and say in the PR how you ran it
    • note in the README that federation (@mercuriusjs/gateway / @mercuriusjs/federation) stays on graphql 16 until those packages support 17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions