Most list queries in the Pluvo API use Relay-style cursor pagination. This means results are returned in pages, and you use cursors to navigate between them.
Paginated queries return a Connection type with this structure:
{
edges {
node { ... } // The actual object
cursor // Opaque cursor string
}
pageInfo {
hasNextPage // Are there more results?
endCursor // Cursor for the next page
}
count // Total number of results
}Use the first parameter to specify how many items you want per page (maximum 50):
query {
paginatedUsers(first: 50) {
edges {
node {
id
name
email
}
}
pageInfo {
hasNextPage
endCursor
}
count
}
}Pass the endCursor from the previous response as the after parameter:
query {
paginatedUsers(first: 50, after: "cursor-from-previous-page") {
edges {
node { id name email }
}
pageInfo {
hasNextPage
endCursor
}
}
}To fetch all results, repeat the query until hasNextPage is false:
first: 50 (no after parameter)hasNextPage is true: query again with after: endCursor, go to step 2hasNextPage is false: donequery GetAllUsers($cursor: String) {
paginatedUsers(first: 50, after: $cursor, archived: false) {
edges {
node {
id
name
email
ref
}
}
pageInfo {
hasNextPage
endCursor
}
count
}
}First call: variables: {}
Subsequent calls: variables: { "cursor": "<endCursor from previous response>" }
| Query | Supports first/after | Supports offset |
|---|---|---|
paginatedUsers | Yes | Yes |
paginatedTrainings | Yes | Yes |
paginatedGroups | Yes | Yes |
portfolioReport | Yes | Yes |
certificates | Yes | No |
first: 50 for maximum efficiency per request.hasNextPage — don't assume there's another page based on result count.count from the first response to estimate total pages or show progress.first: 50 and loop through all pages.