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

Doesn't work with graphql v16+ #628

Closed
Manubi opened this issue Nov 8, 2021 · 11 comments · Fixed by #686
Closed

Doesn't work with graphql v16+ #628

Manubi opened this issue Nov 8, 2021 · 11 comments · Fixed by #686
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Manubi
Copy link

Manubi commented Nov 8, 2021

Hi,
just wanted to update the graphql package to version 16 but fastify/mercurius doesn't seem to like it.

CleanShot 2021-11-08 at 14 38 09

No overload matches this call. Overload 1 of 3, '(plugin: FastifyPluginCallback<MercuriusOptions, Server>, opts?: FastifyRegisterOptions<MercuriusOptions> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Type 'NexusGraphQLSchema' is not assignable to type 'string | GraphQLSchema | string[] | undefined'. Property 'isPossibleType' is missing in type 'NexusGraphQLSchema' but required in type 'GraphQLSchema'. Overload 2 of 3, '(plugin: FastifyPluginAsync<MercuriusOptions, Server>, opts?: FastifyRegisterOptions<MercuriusOptions> | 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<void>'. Overload 3 of 3, '(plugin: FastifyPluginCallback<MercuriusOptions, Server> | FastifyPluginAsync<MercuriusOptions, Server> | Promise<...> | Promise<...>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Type 'NexusGraphQLSchema' is not assignable to type 'string | GraphQLSchema | string[] | undefined'.ts(2769) schema.d.ts(83, 3): 'isPossibleType' is declared here.

Thanks for your help!

@mcollina
Copy link
Collaborator

mcollina commented Nov 8, 2021

Seems about right, we have not updated to GraphQL v16 yet.

@mcollina
Copy link
Collaborator

mcollina commented Nov 8, 2021

Would you like to send a Pull Request to address this issue?

@mcollina mcollina added enhancement New feature or request good first issue Good for newcomers labels Nov 8, 2021
@Manubi
Copy link
Author

Manubi commented Nov 8, 2021

Guess that doesn't make sense right now.
graphql-shield doesn't have updated to v16 either. PR

Also why this PR for an update of graphql in mercurius failed. PR

@giacomorebonato
Copy link
Contributor

Hi @Manubi , the PR seems to be failing because of this:

npm ERR! Could not resolve dependency:
npm ERR! peer graphql@"^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" from graphql-middleware@6.1.12
npm ERR! node_modules/graphql-middleware

graphql-middleware (Mercurius dev dependency) has peer dependency on graphql < 16, so it needs to be upgraded too.

@mcollina
Copy link
Collaborator

We can actually remove that dependency and add the relative example: https://github.com/mercurius-js/mercurius/blob/b671de31178395ea53f2ea39c19cc3f8d80be8eb/examples/graphql-shield-authorization.js.
That dependency is not needed to run, build or test Mercurius.

@giacomorebonato
Copy link
Contributor

Thanks @mcollina , I'll look into that.

@DanTsk
Copy link
Contributor

DanTsk commented Dec 8, 2021

Any updates on this?

@mcollina
Copy link
Collaborator

mcollina commented Dec 8, 2021

Any updates on this?

Would you like to work on it?

@DanTsk
Copy link
Contributor

DanTsk commented Dec 8, 2021

Any updates on this?

Would you like to work on it?

Yes, on the next week I will have some capacity to fix this, but don’t want to interrupt someone’s existing work.

@mcollina
Copy link
Collaborator

mcollina commented Dec 8, 2021

Go for it!

@giacomorebonato
Copy link
Contributor

Sorry, I can't help with this at the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants