Implement an Infinite Scroll using GraphQL with the Vue 3 useQuery Composable

Share this video with your friends

Send Tweet

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.