Apollo server incompatibility? Unexpected GraphQL type definition: AuthTokens (As string: AuthTokens).Please check that you are importing only one instance of the 'graphql' package #9788
Unanswered
Tom-Pearce
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Trying to implement GraphQL code generator into our project. A colleague of mine got it working great on the front end scanning our supergraph and generating types. However, I'm now trying to implement it into each subgraph/microservice individually, so we can generate the relevant resolver types for each service.
It's running in a monorepo with 7 subgraph/microservices, 1 gateway/supergraph server, an API utility package, then several front-end packages for a couple of different applications and some front-end utilities like studio/storybook. We're running Apollo Server 4.4 on all the subgraphs, and graphql 6.6.0.
I'm not really sure where to go with this error, as I can only see 1 gql dependency, unless its maybe a sub-dependency of Apollos server. Added some info below that may be helpful.
Any help, greatly appreciated.
Edit:
I've stripped out the specific microservice into it's own repo, and stripped out all of the dependencies except the codegen ones, and it works. However, as soon as I add
apollo/server
back in, I start getting the error again, so it seems like it's incompatible with Apollo server.NPM package script
codegen.ts
The exact error we're getting:
npm ls
for the specific package/subgraph I'm getting the error in. Bear in mind we're running a monorepo so most dependencies are installed in the root
node_modules
folder and shared. If the full log may be useful, please let me know.Beta Was this translation helpful? Give feedback.
All reactions