Possible to set explicit return types on generated hooks with typescript-react-apollo? #4052
-
Hi there, Does anyone know if it is possible to set explicit return types on generated hooks when using typescript-react-apollo and setting config For example, as I currently observe it, a generated mutation hook results in something like...
Note, the return type is missing on the function. If you look into it, it implicitly has a return type of something like Is there a way of having the generated code explicitly define the return type of the use hook function? E.g. following the same example as above, would look something like...
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
@miller-productions you can use |
Beta Was this translation helpful? Give feedback.
-
@dotansimha Not the OP, but I had the same exact issue. I can use the |
Beta Was this translation helpful? Give feedback.
@miller-productions you can use
ReturnType<useLoginMutation>
to get this type, or you can setwithResultType: true
in order to get this generated ;)