-
Notifications
You must be signed in to change notification settings - Fork 2k
TS: remove TS-specific TData from ExecutionResult #2490
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
Conversation
Reverts DefinitelyTyped/DefinitelyTyped#26763 Since we can't gurantee that response match types it was basically glorified type cast.
…ription * master: TS: remove TS-specific TSource argument for resolveFieldValueOr… (graphql#2491) TS: remove TS-specific TData from ExecutionResult (graphql#2490) TS(definition): remove TS-specific TArgs (graphql#2488)
apollographql/apollo-link#1261 (comment) @IvanGoncharov The generic parameter
For our project, this effectively renders type-checking of the result from mutation hooks defunct since I am not sure how to best work around this regression caused by graphql/graphql-js version 15 within the GraphQL ecosystem. Is this something that needs to be worked around now by higher-order libraries such as apollographql/apollo-link or dotansimha/graphql-code-generator? Where best should I file a bug report? |
This is a pretty significant breaking change that has cascading ecosystem effects. Is it possible to revert this change until a more thorough rationale is provided and more discussion can happen? |
We use graphql-code-generator for codegen, which means that the "glorified type cast" was a pretty qualified guess for the response type in our case @IvanGoncharov |
@erik-beus Totally agree that since
We adopted TS typings from At the same time, if you can explain why |
@IvanGoncharov what about accepted a generic arg but defaulting to the current type? I.e. I see two possibilities among consumers of this library:
|
@davewasmer Ok it's actually reasonable to add a template argument on |
TS specific change. Motivation graphql#2490 (comment)
TS specific change. Motivation #2490 (comment)
@davewasmer Released in https://github.com/graphql/graphql-js/releases/tag/v15.1.0 |
Yep, I think that does it! Thanks @IvanGoncharov |
With this change, it's possible to specify a data type for |
Reverts DefinitelyTyped/DefinitelyTyped#26763
Since we can't gurantee that response match types it was basically
glorified type cast.