How to handle query key requiring object with bigint?
A complex object with bigints should be set as a dependency in the queryKey array, however react-query errors as it is unable to parse the object. How to solve this?
3 Replies
quickest-silver•12mo ago
I think you'd have to write your own
queryKeyHashFn and use superjson to do the serialization
This is what's used by default
wise-whiteOP•12mo ago
I seem to remember reading that react-query sorts the keys deterministically (or something like that), would that be lost i using this approach?
quickest-silver•12mo ago
I'd say you'd have to account for that yup
Something like this should work?