Refactor baseQuery to use RTK Query fetchBaseQuery

Share this video with your friends

Send Tweet

There are a lot of edge cases that our simple fetch code is not handling. RTK Query has a great utility function called fetchBaseQuery that will execute a fetch and handle those annoying edge cases that you don't need to think through. We will refactor to use fetchBaseQuery with a "base url" and explore some new options like params and method we get as a result.