You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now every query function has a possibility to have on overwritten return type by using a TData generic. There is the responsible code. This generic looks strange because query functions will always return the same data. Also there is another problem with this approach: typescript unable to calculate queries return type dynamically because there is no guarantee that they wasn't overwritten.
Yeah, but we are talking about the axios generator, not about the react-query generator. In my project react-query is also used but we have a special typescript helpers overlay for it on top of the axios query functions.
To make this work right there should be a possibility for the typescript to infer the return type for the query function. Using generics with a default value we are loosing this option because there is no guarantee that generic wouldn't be redefined.
Right now every query function has a possibility to have on overwritten return type by using a
TData
generic. There is the responsible code. This generic looks strange because query functions will always return the same data. Also there is another problem with this approach: typescript unable to calculate queries return type dynamically because there is no guarantee that they wasn't overwritten.I think it should look like this:
The text was updated successfully, but these errors were encountered: