V4 - ApolloServer TSError Expected 0 type arguments but got 1. #7368
Unanswered
DanielPachecoAr
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Massive, syntactically incorrect, and incomplete snippets don't really help me to get you to the bottom of your problem. Can you please send a codesandbox link or provide an actual reproduction that I can clone or run locally which demonstrates the issue in a concise way? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following code baesd on the migration examples from the apollo page.
import { ApolloServer } from '@apollo/server'; import { expressMiddleware } from '@apollo/server/express4';
From that code Im getting the following typescript compilation errors:
TSError: ⨯ Unable to compile TypeScript: index.ts:XX:41 - error TS2558: Expected 0 type arguments, but got 1.
Im able to bypass these errors using:
// THIS // @ts-ignore const apolloServer = new ApolloServer({ typeDefs: schema, resolvers, plugins: [...], apollo: { key: APOLLO_KEY, graphRef: APOLLO_REF } }) as any; // AND THIS
And the serverworks, however Im hoping get some help in order not to use those workarounds.
BTW HERE is the ApolloServer definition, and I get to that file when ctrl+clicking the call on my code.
Beta Was this translation helpful? Give feedback.
All reactions