tRPCttRPC
Powered by
jJ
tRPC•12mo ago•
1 reply
j

Extra query keys for functions for invalidation

Is it possible to easily provide extra query hashes for functions?

For example, lets say i have a procedure

GetCurrentState()

With no input.

Before when i used raw react query, i could do

UseQuery({ queryKey: ["currentState", dependency] })

To easily add dependencies to the query key function even if the fetch itself may not need it.

How would i do this? I think modifying queryHashFn option or adding arbitrary input to procedure is hacky
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Query keys
ZephZZeph / ❓-help
4y ago
Query invalidation per mutation-key
simonsimcitySsimonsimcity / ❓-help
11mo ago
tRPC + React Query Data Invalidation?
rhh4x0RRrhh4x0R / ❓-help
2y ago
Optimizing Global State Updates for Mutations Across Multiple Query Keys in tRPC with React Query
shanksxzSshanksxz / ❓-help
14mo ago