Course lesson
Implement an Infinite Scroll using GraphQL with the Vue 3 useQuery Composable
We have a thousand crafts but our app currently only displays twenty. We can use the fetchMore method off of the useQuery composable to run our query again with new variables.
- Duration
- 3 min
- Access
- Included
- Transcript
- Retained from source evidence
We have a thousand crafts but our app currently only displays twenty. We can use the fetchMore method off of the useQuery composable to run our query again with new variables.
We modify our query to take an offset variable. And then in our app, when we run fetchMore and concat the query results to our existing array of crafts.