Skip to content
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

An issue with the Apollo Federation dependency. #1782

Closed
3 of 15 tasks
NeutronScott12 opened this issue Oct 8, 2021 · 7 comments · Fixed by #1797
Closed
3 of 15 tasks

An issue with the Apollo Federation dependency. #1782

NeutronScott12 opened this issue Oct 8, 2021 · 7 comments · Fixed by #1797

Comments

@NeutronScott12
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Well, I don't know if I should be bugging Apollo or you guys, but all of a sudden I got this error -

The "@apollo/federation/dist/directives" package is missing. Please, make sure to install this library ($ npm install @apollo/federation/dist/directives) to take advantage of SchemaBuilder

I tried re-installing node_modules, checking for newer versions. I haven't check older versions, but I haven't updated for at least a week, so it's a weird problem.

I suspect either some change happened to your Graphql module or apollo changed something.

"@nestjs/graphql": "^9.0.5"

It could be a yarn workspace issue as well, so many edge cases.

Minimum reproduction code

https://github.com/OGNeutron/TheLastHurrah/tree/master/packages/the-last-hurrah-commence

Steps to reproduce

No response

Expected behavior

Well, I install it and it works. 👍

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

@nestjs/graphql

NestJS version

8.0.10

Packages versions

"dependencies": {
"@casl/ability": "^5.4.3",
"@casl/prisma": "^1.0.0",
"@nestjs/axios": "^0.0.2",
"@nestjs/common": "^8.0.10",
"@nestjs/config": "^1.0.2",
"@nestjs/core": "^8.0.10",
"@nestjs/graphql": "^9.0.5",
"@nestjs/jwt": "^8.0.0",
"@nestjs/microservices": "^8.0.10",
"@nestjs/passport": "^8.0.1",
"@nestjs/platform-express": "^8.0.10",
"@nestjs/throttler": "^2.0.0",
"@nestjs/typeorm": "^8.0.2",
"@prisma/client": "^3.2.1",
"@thelasthurrah/the-last-hurrah-shared": "^0.0.5",
"apollo-server-cache-redis": "^3.1.0",
"apollo-server-express": "^3.3.0",
"axios": "^0.22.0",
"class-validator": "^0.13.1",
"cross-env": "^7.0.3",
"graphql": "^15.6.1",
"graphql-type-json": "^0.3.2",
"helmet": "^4.6.0",
"ioredis": "^4.27.10",
"joi": "^17.4.2",
"passport": "^0.5.0",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"pg": "^8.7.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0",
"ts-morph": "^12.0.0",
"typeorm": "^0.2.37",
"yup": "^0.32.9"
},
"devDependencies": {
"@nestjs/cli": "^8.1.2",
"@nestjs/schematics": "^8.0.0",
"@nestjs/testing": "^8.0.10",
"@types/express": "^4.17.13",
"@types/jest": "^27.0.1",
"@types/node": "^16.10.2",
"@types/passport-jwt": "^3.0.6",
"@types/passport-local": "^1.0.34",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"eslint": "^7.30.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.2.4",
"prettier": "^2.3.2",
"prisma": "^3.2.0",
"supertest": "^6.1.3",
"ts-jest": "^27.0.3",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "^3.10.1",
"typescript": "^4.3.5"
},

Node.js version

16.8.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@abernix
Copy link

abernix commented Oct 8, 2021

Hey! Apollo maintainer here — I just want to draw the connection to the same issue that was also opened on the Apollo Federation repository, where I responded to @OGNeutron: apollographql/federation#1065.

This internal module has been moved from the @apollo/federation to the @apollo/subgraph package. If you have a chance to explain the use-case for needing it, it'd be good to add perspective to the issue I linked so we can consider use-cases for exporting it! In the meantime, you'll want to pin to an earlier version of @apollo/federation that still has the module in the dist/ subpath, or consider updating to @apollo/subgraph instead (you should update anyhow, but would still generally advise against importing from the subpath as we don't consider that stable API surface area!) Thanks!

@ssukienn
Copy link

ssukienn commented Oct 8, 2021

I can confirm, needed to the downgrade apollo/federation to 0.33.0

@kamilmysliwiec kamilmysliwiec transferred this issue from nestjs/nest Oct 8, 2021
@NeutronScott12
Copy link
Author

I can confirm, needed to the downgrade apollo/federation to 0.33.0

I checked @nestjs/graphql in node_modules and it's the same as well, but still getting the same problem.

@kamilmysliwiec
Copy link
Member

Just make sure to use 0.33.0 instead of 0.33.1 and you should be fine.

@NeutronScott12
Copy link
Author

NeutronScott12 commented Oct 8, 2021

That doesn't seem like a solution either, I deleted all node_modules, cleared yarn cache, removed lock files and then re-installed, went to check node_modules saw that apollo/federation was 0.33.0 and still got this issue.

*Got it working, all good, have a nice day peeps.

@kamilmysliwiec
Copy link
Member

Let's track this here #1797

@abernix
Copy link

abernix commented Oct 19, 2021

I agree that #1797 is a step in the right direction (and the follow-up suggestion that it makes is appropriate, too!)

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

Successfully merging a pull request may close this issue.

4 participants