-
Notifications
You must be signed in to change notification settings - Fork 17
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
Query options behaving differently in v2 #494
Comments
Hey @ryanlntn Sorry to hear you're having trouble with the migration. Let me just lay out what I understand:
I think that sums up the problem. If it doesn't, it might help to provide a minimum reproduction with exact behaviour and expectations. The way query keys are built has changed quite a bit in V2 and now more accurately represents possible changes to underlying transport (middleware, baseURL, etc). So things like One way you can tell for sure this is something that's happening is by calling something like console.log(createConnectQueryKey({
schema: someRpc,
input: { ... },
transport,
cardinality: undefined,
}) If you notice that the produced object looks different between calls, it's likely because of transport. You'll want to key your transport with a consistent key that only changes when it needs to: |
Note that using |
@paul-sachs That makes sense and that was it. Updating to:
resolves this for me. Thanks! |
I'm attempting to upgrade to v2 and I'm running into an issue with query options. I have a query that I'm defaulting to
staleTime: Infinity
and manually force refetching. Previously this worked as expected withdata
being present and no request made until manually refetched. I was already on the latest version of@tanstack/react-query
and their docs describe this behavior so it appears something changed inconnect-query
within v2 to break this.The text was updated successfully, but these errors were encountered: