-
Notifications
You must be signed in to change notification settings - Fork 463
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
graphql is not declared as peer dependency #3724
Comments
That in turn does have types that either rely on If you have a specific question or issue, it might instead be a usage question, for which a discussion thread would be more suited ✌️ For now, since there's no reproduction or more details I'll temporarily close this though |
Hi @kitten, Thank you for the prompt response! So I did a little more digging to understand 0no-co/graphql.web and urql and I was able to find the root cause. So if my understanding is correct graphql.web will use types from graphql if it can be resolved, otherwise will fallback to its local definitions. It does that using a utility type similar to this one: type Or<T, U> = 0 extends 1 & T ? U : T; urql-core tries to do the same thing with On to the issue at hand. Typescript changed the behaviour of "unresolved" any from 5.5 so doing This can be fixed by updating the utility type in both urql and graphql.web to: type OrFixed<T, U> = void extends T ? U : T; I will open a PR with a fix for both libraries tomorrow. urql might also need to bump the dependency version of graphql.web. Here is a reproduction repo https://github.com/andreisergiu98/urql-repro-3724. The affected code resides in With this new information are you willing to reopen the issue? Also would you consider adding graphql as an optional dependency to urql to satisfy the passthrough for graphql.web, otherwise yarn berry will never resolve graphql for it even if installed? |
Describe the bug
graphql
is not declared as a peer dependency neither for theurql
package nor@urql/core
. While it happens to work with npm and pnpm because of the fs lookup, it breaks for yarn pnp.While so far, for me, the only thing that broke was the type inference because all graphql types will fallback to any, there is runtime code also which won't work at all.
Solution:
@urql/core
and all packages that rely on it must have graphql as required peer dependency.Reproduction
.
Urql version
v4.2.1
Validations
The text was updated successfully, but these errors were encountered: