Skip to content

Apollo + Fastify version conflicts #3554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 4 tasks
roypeled opened this issue Apr 14, 2025 · 1 comment
Open
2 of 4 tasks

Apollo + Fastify version conflicts #3554

roypeled opened this issue Apr 14, 2025 · 1 comment

Comments

@roypeled
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Trying to upgrade nestjs to latest versions I encounter peer deps conflicts.
I am using fastify, so I have @nestjs/platform-fastify installed.
upgraded to v11 it has a peer dep to "fastify": "5.3.0".

I upgraded @nestjs/apollo to 13.1.0.
it has a peer dep to @as-integrations/fastify: 2.1.1

@as-integrations/fastify has not been updated for the past 2 years.
It has a peer dependency to "fastify": "^4.4.0".

Running the server without @as-integrations/fastify breaks with an error The "@as-integrations/fastify" package is missing. Please, make sure to install it to take advantage of GraphQLModule from this line(https://github.com/nestjs/graphql/blob/master/packages/apollo/lib/drivers/apollo-base.driver.ts#L179)

However the @nestjs/apollo documentation doesn't even mention this lib: https://www.npmjs.com/package/@nestjs/apollo instead asking to install apollo-server-fastify which has been deprecated (https://www.npmjs.com/package/apollo-server-fastify)

If there is any alternative, please suggest it, otherwis issue a breaking change to the latest versions describing that apollo no longer supports fastify.

Minimum reproduction code

https://www.npmjs.com/package/apollo-server-fastify

Steps to reproduce

npm i @nestjs/platform-fastify
npm i @nestjs/apollo
npm I fastify
npm i @as-integrations/fastify OR npm i apollo-server-fastify

Expected behavior

either remove @as-integrations/fastify dependency or deprecate fastify

Package version

13.1.0

Graphql version

graphql: 16.10.0
apollo-server-express: NA
apollo-server-fastify: 3.13.0

NestJS version

11.0.16

Node.js version

v20.18.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@Tony133
Copy link
Contributor

Tony133 commented Apr 21, 2025

If you use the @nestjs/platform-fastify package, I recommend that you do not use the @as-integrations/fastify package, which does not seem to be up-to-date anymore, the last change was 2 years ago. Better to use mercurius, the following explains how to install it:

# Fastify and Mercurius
npm i @nestjs/graphql @nestjs/mercurius graphql mercurius

An alternative can be Graphql Yoga, if you might be interested it also works with Fastify, see here: https://the-guild.dev/graphql/yoga-server/docs/integrations/integration-with-nestjs.

I hope I have been helpful 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants