Peform
trpc caching procedure calls for queries in the same batch
Hi thank you for the response.
I am already using redis, which does help once the data is cached. and the redis lock could help if there is no data cached, But, it still seems a little redundant to fetch data from redis multiple times for requests in the same batch, so I am curious about the
createContext
method.
When you say put the check inside of my create context, are you talking about the trpc context which has the db connection, users session etc?
only some of my endpoints do this "expensive check", but all endpoints require the context I which I have above ^. Would the solution to this be creating multiple contexts for each type procedure? (maybe its possible to chain contexts?)
if i were to make new contexts for each procedure, im unsure how id be able to get the required data from the request in order to pass into my permission checking function9 replies
mutation taking a long time to appear after prefetching query
im just so confused, because the query knows it errored, but
<hydrateclient>
isn't passing the error object down to the client
A demonstration of the issue:
https://gyazo.com/610a1e2d835445e70fd2400812cad7c92 replies
TRPC response data changing to undefined when typing in a form field.
And as an extra question, is this method of data querying a best practise? I feel like for data querying like this a useMutation is better suited, even though mutations are for changing data not querying... the syntax for mutations is much better suited for this scenario I believe.
4 replies