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
When I'm trying to call useQuery() outside setup function, like in router, for example, and it claims that I can't do that because it have no way to inject client outside setup.
But there is a different form of the same functions exists, called callUseQuery for useQuery, callUseMutation for useMutation and so on.
Even more, internally useQuery is just calling callUseQuery skipping any extra parameters like client:
So maybe it is better to generate functions using this 'call' form with optional parameters?
This way user would be able to inject client manually if needed.
Because for now, the only way to do that is to repeat generated function manually somewhere, which breaks all the profits of automatic code generation
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When I'm trying to call
useQuery()outside setup function, like in router, for example, and it claims that I can't do that because it have no way to inject client outside setup.But there is a different form of the same functions exists, called
callUseQueryforuseQuery,callUseMutationforuseMutationand so on.Even more, internally
useQueryis just callingcallUseQueryskipping any extra parameters like client:So maybe it is better to generate functions using this 'call' form with optional parameters?
This way user would be able to inject client manually if needed.
Because for now, the only way to do that is to repeat generated function manually somewhere, which breaks all the profits of automatic code generation
Beta Was this translation helpful? Give feedback.
All reactions