From the course: TanStack Query: Efficient Data Fetching and State Management

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Fetching repo data

Fetching repo data

- [Instructor] Right now in our application, we are only using a couple fields from the GitHub API. Of course there are more, and we can prove that to you by showing you in the TanStack Developer Tools here, there's a ton of different links that we could follow. Now, this repos_url, this is one piece of data that comes back when we ask for this user's data. And this could be very, very long. So many of these repos that this user has created would need to be displayed if I'm going to ask for that data from the API. So, the first thing that we want to do is we want to start to plug these repos into this user interface. And then, in a later video, we're going to make it even better by incorporating pagination. So, let's go ahead and take a look at this. We need to do two things. Just like before, if we want to fetch some data, we need to write that fetcher. So we're going to fetchUserRepos this time. This is, again, an asynchronous function. It takes in a username. That username is a…

Contents