From the course: Building a GraphQL Project with React.js

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Creating dynamic queries

Creating dynamic queries

- [Instructor] It's time to start programming some other functionality for controlling our list. So to take care of that, I'm going to create some new variables. I'll start with a pageCount variable here. And I'll go ahead and take care of that with useState. Now initialize that. For right now, we will look for items that have the keyword slides in them. So I have a few slides on different projects. That will be a good one to start with. Let's go ahead and copy this one couple of times. Then I will use a queryString. And I got to remember to capitalize it here 'cause that's the sort of style for this. And it's actually for queryStrings I want to have the keyword slides. But for the pageCount, I'll just pass along a number of 10 items. Then the last one will be totalCount. So this would be how many items I receive back from querying the database. All right, so, what I'm going to do in here is create a new constant or…

Contents