Skip to content
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

trpc 10.7.0 getQueryKey => SW & agnostic cache invalidation #34

Closed
Sheraff opened this issue Jan 2, 2023 · 1 comment
Closed

trpc 10.7.0 getQueryKey => SW & agnostic cache invalidation #34

Sheraff opened this issue Jan 2, 2023 · 1 comment

Comments

@Sheraff
Copy link
Owner

Sheraff commented Jan 2, 2023

Every time we need agnostic access to the cache (mainly for cache invalidation on messages from service worker), we should use getQueryKey instead of assuming we know the shape of the key.

Right now, every version upgrade of tRPC needs to be thoroughly checked because a change in the underlying react-query cache keys and/or request param syntax might not be marked as "breaking" (since most users probably don't rely on them). Having a less leaky abstraction might make the whole thing more robust.

@Sheraff
Copy link
Owner Author

Sheraff commented Apr 23, 2023

getQueryKey doesn't really apply (i think) because we're only "creating keys" from the service worker by intercepting already formed requests

@Sheraff Sheraff closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant