-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
typescript-vue-urql typing issue with generated code #9421
Comments
Can confirm with typescript-urql as well, this is an issue for me. Seems like the urql developers were aware that this would break in codegen according to this: urql-graphql/urql#2606 (comment) |
+1 |
@DevelonPro, @kefniark: Do you know a workaround until it is fixed? |
Sadly, except using older version of urql, not really |
For further reference, this bug was also reported as issue #328 in dotansimha/graphql-code-generator-community with a PR that resolves the issue. This could serve as a workaround. |
The relevant change in urql is reported here: urql-graphql/urql#2607 |
Hello, any news ? |
Sadly not much, |
It looks like this is now available as an alpha release https://www.npmjs.com/package/@graphql-codegen/typescript-vue-urql/v/3.0.0-alpha-20230911210300-bd6b199b9 Only problem is that typing is not fixed for Subscriptions export function useFoobarSubscription<R = FoobarSubscription>(options: Omit<Urql.UseSubscriptionArgs<never, FoobarSubscriptionVariables>, 'query'> = {}, handler?: Urql.SubscriptionHandlerArg<FoobarSubscription, R>) {
return Urql.useSubscription<FoobarSubscription, R, FoobarSubscriptionVariables>({ query: FoobarDocument, ...options }, handler);
};
|
I had the same issue (with subscriptions in particular) but it got resolved after I updated to the latest versions. So make sure that you're on the latest version.
|
@semanser Can not confirm. |
Also can not confirm, this problem is still persistent. This is relevant to subscriptions. I tested today using
|
As of |
This issue not fixed in 3.1.0 |
Which packages are impacted by your issue?
@graphql-codegen/typescript-vue-urql
Describe the bug
The issue I'm running into is that the code generated by
typescript-vue-urql
is not compatible with recent version of@urql/vue
. Apparently one of the propertyvariables
is optional in the generated code, but not for@urql/vue
, causing some typescript errors.I'm ignoring this issue for months by just not bumping urql version, but now I need to update and I running into this codegen issue once again.
Your Example Website or App
https://github.com/kefniark/issue-codegen-urql-vue
Steps to Reproduce the Bug or Issue
Please check the Readme.md
yarn
: install depsyarn generate
: use codegen to generate client codeyarn test
: validate the client codeExpected behavior
The generated code should match
@urql/vue
typings.Screenshots or Videos
Platform
in the reproduction repository everything is freshly installed and up-to-date (codegen, typescript, urql)
The text was updated successfully, but these errors were encountered: