0

I am trying to use typegraphql with mercurius and fastify I have copied this intergration from mercurius documentaion, when I add the built schema to mercurius it show me an error in this way:

enter image description here

When I remove it, the error disappear

enter image description here

This is the error message shown:

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'.

Ghyath Darwish
  • 2,614
  • 4
  • 15
  • 31

1 Answers1

0

I had to downgrade graphql packages from version 6 to 4 because the mercurius does not support graphql 6 until now.

Ghyath Darwish
  • 2,614
  • 4
  • 15
  • 31