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-react-apollo] Create options for typed QueryResult, MutationResult and MutationOptions #2144
Comments
@eddeee888 a PR would be great. We have this for hooks (#2133), but not for component/hoc. |
Hey sorry for the interrupt, but maybe I'm having troubles with this line:
which maybe generates following code: export type SaveTagsMutationOptions = ReactApollo.MutationOptions<
SaveTagsMutation,
SaveTagsMutationVariables
>; IDE will complain about error like below:
Changed Let me know if this helped, thank you all! |
Hi @18601673727 ! This is supposed to be used for the non-hook version i.e. Also, it's worth to double-check if the type name is different between official beta |
Hi @eddeee888 ! Got it, this is actually from |
Available in 1.5.0 🎉 |
In my projects, I'm using
typescript-react-apollo
plugin and I find myself having to type things likeQueryResult
,MutationResult
andMutationOptions
quite often as I use these types in other components quite often. For example:There's already a config for
withMutationFn
as seen here. Is there a plan to support other types?At the moment, I have forked from master and created options called:
withResultType
: boolean, will generate*QueryResult
and*MutaionResult
withMutationOptionsType
: boolean, will generate*MutationOptions
I'm happy to create a PR to add these options if that's a feature we want to have?
The text was updated successfully, but these errors were encountered: