-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Learn React with TypeScript - Second Edition
By :
In this section, we will build an app containing a form that allows users to search and star GitHub repositories. The app will also have a header containing our name from GitHub. We will use the browser fetch function with React Query to interact with the GitHub GraphQL API. Let’s get started.
We will create the header for the app, which will contain our GitHub name. We will create a Header component containing this, which will be referenced from the App component. The Header component will use React Query to execute a function that gets our GitHub name calling the GitHub GraphQL API.
Carry out the following steps to create a function that makes a request to the GitHub GraphQL API to get details about the logged-in viewer:
api folder in the src folder.