How to modify existing cache data?
I have a message queue being fetched with InfiniteQuery requests. When adding a new message, I want to prevent client-reload by adding the message to the front of the existing messages array. Is the tool for this
setInfiniteData()
?
When I return a modified version of the existing cache-data, TS throws errors about the [cachedData
] being recursively incorrectly formatted no matter what I do ๐ !
Q1: This is way outside my league but I noticed this: Is there possibly an error in the [react-query] TS-definition at https://github.com/trpc/trpc/blob/main/packages/react-query/src/shared/proxy/utilsProxy.ts lines 155+156 because they are duplicates.
Q2: What am I doing wrong here? Am I just using the wrong tool?
Any help is greatly appreciated!
(env is React/Next13 via T3-Stack)GitHub
trpc/packages/react-query/src/shared/proxy/utilsProxy.ts at main ยท ...
๐งโโ๏ธ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/packages/react-query/src/shared/proxy/utilsProxy.ts at main ยท trpc/trpc
0 Replies