'Custom query cache key with RTK (redux toolkit query)

Have tried reading the docs but nothing,is there a way to override the default RTk query cache key mechanism so i can setup my own keys like in react query ? if so how ?



Solution 1:[1]

Yes, using serializeQueryArgs.

But generally, cache keys in RTK Query are an implementation detail and I don't think there is a lot of good reason to fiddle with that?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 phry