Appendix
There are a couple of topics that are not directly related to the application we built, but they are worth mentioning.
GraphQL
Having a GraphQL API is a very common thing nowadays, especially in a microservices architecture. We worked with a REST API in our application, but how would we structure our API layer if it were a GraphQL API?
Well, the implementation would be very similar. We could choose to use a different library, such as Apollo, but we will stick with React Query.
Look at the following request:
import { request, gql } from "graphql-request"; import { useQuery } from '@tanstack/react-query'; const jobsQuery = gql` query { jobs { data { &...