Page through your query results and control the number of results you want to return each time.

The GraphQL wire adapter follows the GraphQL Cursor Connections Specification for pagination.

To specify the number of records to return, use the first argument. The default number is 10.

If hasNextPage is true, you can supply the value of endCursor to the after argument of a subsequent query to request the next page of results.

Backward pagination arguments last and before are currently not supported.

To create a query with cursor information, use the query parameter of the GraphQL wire adapter.

This example response contains cursor information.

The lwc-recipes repo has many GraphQL API examples. Look for components that start with graphql, such as graphqlPagination.

See Also