Set up RTK Query with createAPI and ApiProvider that Serve Fake Data

Share this video with your friends

Send Tweet

The first thing we need to do to set up Redux Toolkit Query is to create API end points and wrap our application in an ApiProvider that RTK Query gives us. For this application, we will expose two endpoints. One endpoint will be the list of all pokemon and the other will be the pokemon detail page.

Then we'll use the endpoints we built and load the data from RTK Query hooks along with loading and error states.