Search code examples
reactjsreduxredux-toolkit

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

  • 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?