I'm introducing RTK Query in my project. However, the data retrieved from one endpoint (created with createApi
) is fed to the D3 library which immediately starts to mutate the data. Since RTKQ returns immutable data, D3 throws an error saying object is not extensible
. So my question is
Is there a way to disable immutability with RTKQ for a particular endpoint?
I understand that I can copy the retrieved data & use the copy down the road but I would like to avoid doing it.
Note, that the data is not part of the application state so I cannot disable immutability with ignoredPaths
as described in the docs.