Comments (7)
You're free to make a PR to implement, but we'd have to update
- utils proxy
- any SSR fetcher
- all of
useQuery
/useInfiniteQuery
/ [...]
Not sure if it's worth the squeeze, we've had 3 years of no one reporting an issue related to this so it feels like an edge-case and I'd like us to just piggy-back on RQ's hash fn that works great for the 99% use-case
AFAIK, you can still pass the hashQueryFn
in tRPC as well as we just forward the options from RQ
from trpc.
If this is a bug, it's with 95% probability a bug in https://github.com/TanStack/query and not tRPC
from trpc.
Sandbox with raw RQ: https://stackblitz.com/edit/github-wgxcnf?file=src%2Findex.jsx
The first one represents the flow tRPC would work. We don't serialize the input before using is as a query key, so the query doesn't update.
We could "fix" this in trpc by transforming input before using is as a query key, although I'm not sure how wise that is 🤔
CleanShot.2024-04-25.at.11.01.12.mp4
from trpc.
Yeah, this is most likely an issue in RQ's getQueryKey
, but we shouldn't fix it in tRPC.
@BrendanC23 could you open an issue at https://github.com/TanStack/query using @juliusmarminge' sandbox above?
from trpc.
I created this React Query issue. They will not fix it on their end.
we only support json serializable values in the key. If you need something more, you can provide your own queryKeyHashFn and use something like superjson to serialize Sets.
from trpc.
Yeahhhhh..... I don't think we'll do this.
There are a lot of places we depend on the query hash being whatever RQ produces so I think it'll be quite hairy to make this work.
I'd advise you not to use Set
s as an input argument. Personally, I only use JSON-serializable values as it maps better to React and <form>
s etc, and if something needs to be a complex type, i use .transform(() =>
on code zod schema
from trpc.
This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you.
from trpc.
Related Issues (20)
- bug: Cannot find module '@web3-storage/multipart-parser' HOT 6
- bug: request body read multiple times HOT 2
- bug: initializing websockets HOT 4
- feat: Expose `TRPCBuilder` class or interface HOT 3
- bug: error: NEXT_REDIRECT HOT 1
- feat: Lazy load WS connection as needed HOT 2
- docs: Add TypeBox to Library integrations
- bug: 'hashQueryKey' is not exported from '@tanstack/react-query' HOT 5
- bug: cannot get router type output HOT 2
- bug: responseMeta sets wrong value to AllowOrigin CORS header HOT 7
- bug: vue-tsc errors HOT 7
- bug: trpc/server node-http adapter fails to read large POST body HOT 1
- bug: Caching too hard, when working with headers
- bug: Dependency mismatch for `@tanstack/react-query` HOT 2
- docs: httpBatchLink can only be used with API Gateway + Lambda if using a single resource for the router HOT 3
- bug: Disconnected subscriptions don't re-subscribe after reconnecting HOT 19
- docs: Missing App Router information HOT 1
- feat(server + client): propagate errors when iterators fail HOT 1
- feat: allow the customization of namespace delimiter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trpc.