Integrating the API into the Application
In the previous chapter, we went through setting up the mocked API, which we will be consuming in our application.
In this chapter, we will be learning how to consume the API via the application.
When we say API, we mean the API backend server. We will learn how to fetch data from both the client and the server. For the HTTP client, we will be using Axios, and for handling fetched data, we will be using the React Query library, which allows us to handle API requests and responses in our React application.
In this chapter, we will cover the following topics:
- Configuring the API client
- Configuring React Query
- Creating the API layer for the features
- Using the API layer in the application
By the end of this chapter, we will know how to make our application communicate with the API in a clean and organized way.