redux-toolkit
redux-toolkit copied to clipboard
RTK Query : Code splitting Same endpoint from different slice.
Hi team, Im using RTK Query in my project and recently added injectendPoints for code split my service apis, from emplty api slice.
But I'm having issue as I have multiple external endpoints sometime we face issue of same endpoint name which results in running someother endpoint instead of invoked endpoint that we are using on that page.
Even tried to set overrideexisting endpoint to true , but now previous endpoint doesn't work. How can we use same endpoint names from different external end points.
injectApis means exactly that: it constructs one api by injecting multiple endpoints into the same api. You cannot use the same name twice. If you would set overrideExistring: true, it would do that: override existing endpoints, throwing their definition away.
You have to use different names for different endpoints.
That's why earlier I was using multiple api slice but after 30 + api slices I get warning message that middleware doesn't exist. Okay, thanks I'll have to change endpoints name than