Replies: 1 comment
-
|
zodios used to do this pretty well, not sure what the status is though |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Getting tRPC-style organisation with plain React Query
Hi everyone
One of the things I envy about tRPC projects is the organisational clarity you get for free:
Everything is namespaced, grouped, and discoverable. There's no query key management problem because keys are derived from the router structure. You know exactly where to look for anything posts-related.
I want that same organisational DX on a project that doesn't use tRPC. No extra backend setup, just React Query on the client.
What I've been experimenting with
Since
queryOptionsalready encapsulates the query key, you can use a plain namespace object as both the key factory and the options factory:What I'm hoping to learn
@lukemorales/query-key-factory, is no longer maintained.)Thanks!
Beta Was this translation helpful? Give feedback.
All reactions