rtk-incubator / rtk-query

Data fetching and caching addon for Redux Toolkit
https://redux-toolkit.js.org/rtk-query/overview
MIT License
626 stars 31 forks source link

How to dynamically add entityTypes? #153

Closed kahirokunn closed 3 years ago

kahirokunn commented 3 years ago

In the api instance generated by rtk-query-codegen, entityTypes is empty by default.

If you want to add or modify endpoints dynamically by using libraries, you may want to add entityTypes.

What should I do in this case?

msutkowski commented 3 years ago

Hmm, i tried to link the docs, but they broke... This should be documented here: https://rtk-query-docs.netlify.app/concepts/code-generation#openapi. You're looking for 'addEntityTypes' of enhanceEndpoints if it doesn't link properly.

kahirokunn commented 3 years ago

It worked! Thank you!