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
Hey all, I'm playing with the createConnectQueryKey and I'm wondering if there is a way to allow TS to better infer the return type when using it in conjunction with the tanstack queryclient.setQueryData.
It's able to infer the some of the types, but not all of them. Arguably the most important being the actual value that the cache is going to be updated to.
Screenshot below shows an example. TS is definitely inferring some of the types, but the updater is still set to unknown.
It would be awesome if by passing in the query key if the updater could be set to the response type, in this case, GetAccountOnboardingConfigResponse
The text was updated successfully, but these errors were encountered:
I don't think TanStack's QueryClient.setQueryData - which we are using here - can infer data type from the key type. To enforce matching key and value, we'd have to provide our own API to set query data.
Hey all, I'm playing with the
createConnectQueryKey
and I'm wondering if there is a way to allow TS to better infer the return type when using it in conjunction with the tanstackqueryclient.setQueryData
.It's able to infer the some of the types, but not all of them. Arguably the most important being the actual value that the cache is going to be updated to.
Screenshot below shows an example. TS is definitely inferring some of the types, but the
updater
is still set tounknown
.It would be awesome if by passing in the query key if the
updater
could be set to the response type, in this case,GetAccountOnboardingConfigResponse
The text was updated successfully, but these errors were encountered: