-
Notifications
You must be signed in to change notification settings - Fork 238
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
Couldn't use typegraphql with mercurius #665
Comments
I don't have a clue, I'm sorry I can't help. |
@mcollina |
Facing the same problem using the latest versions of all packages, how can this be fixed? |
Could you output the following or even better provide a reproducible example please? npm why graphql
npm why fastify
npm why mercurius
npm why type-graphql |
Actually the problem seems to be that |
Sorry for being dense is there a resolution for this? I am getting the same errors as above and have downgraded my graphql package to 15.3.0.
|
@bmccorm2 - The issue is with TypeGraphQL. Not Mercurius. If you are looking for the TypeGraphQL experience, where it also works with v16 of GraphQL (and also gives you a modules/DI system which you have to add with TypeGraphQL), you could try NestJS' code-first approach. Nest now supports Mercurius out of the box. Scott |
Thanks @smolinari. So if i understand correctly, the stack of fastify/mercurius/typegraphql is not compatible at this time correct? I tried to get it to work on Nest to no avail and i also tried the vanilla example from the site below. Same error as above - all with graphql 15.3.0. https://mercurius.dev/#/docs/integrations/type-graphql?id=integrating-typegraphql-with-mercurius |
@bmccorm2 - Mercurius and TypeGraphQL should work together with v15 of GraphQL. And, when you say "tried to get it to work with Nest" are you speaking of TypeGraphQL? If yes, you don't need it. Nest has it's own TypeGraphQL-like module. In fact, Nest used to use TypeGraphQL in the past, but went away from it, for reasons I don't know. But, their new GraphQL module is just as good as TypeGraphQL. Scott |
You will have to use v8 of Mercurius because that's the one that supports GraphQL v15. I'm not sure what is blocking the upgrade of TypeGraphql but it seems there is some activity there, so hopefully it will be resolved soon. |
@smolinari - sorry i didn't know that nest had its own graphql module similar to typeGraphQL. I'll give that a try. @smolinari / @mcollina - I copied the two files from the recipe below. They won't run because of typing errors. V8 of mercurius and v15 of graphql. Are you saying you are able to get those to run?
|
I am trying to use typegraphql prisma generator, when I pass the built schema to mercurius plugin it shows this error
No overload matches this call. Overload 1 of 3, '(plugin: FastifyPluginCallback<MercuriusOptions, Server>, opts?: FastifyRegisterOptions | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Type 'GraphQLSchema' is not assignable to type 'string | string[] | GraphQLSchema | undefined'. Type 'GraphQLSchema' is missing the following properties from type 'GraphQLSchema': description, getImplementations, isSubType Overload 2 of 3, '(plugin: FastifyPluginAsync<MercuriusOptions, Server>, opts?: FastifyRegisterOptions | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Argument of type 'typeof mercurius' is not assignable to parameter of type 'FastifyPluginAsync<MercuriusOptions, Server>'. Type 'void' is not assignable to type 'Promise'. Overload 3 of 3, '(plugin: FastifyPluginCallback<MercuriusOptions, Server> | FastifyPluginAsync<MercuriusOptions, Server> | Promise<...> | Promise<...>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Type 'GraphQLSchema' is not assignable to type 'string | string[] | GraphQLSchema | undefined'.
The text was updated successfully, but these errors were encountered: