The attendeesConnection query returns the attendees of an event (gathering in the schema, selected with gatheringId) one page at a time. It follows the Relay cursor connections specification.
attendeesConnection is the only paged list in the API. Every other list query returns all items in one response.
Arguments
| Argument | Type | Use |
|---|---|---|
first |
Int |
The number of items to return, counted from the start of the list or from the cursor in after. |
after |
String |
Return the items that come after this cursor. |
last |
Int |
The number of items to return, counted from the end of the list or from the cursor in before. |
before |
String |
Return the items that come before this cursor. |
To read forward, use first with after. To read backward, use last with before.
Each request must have first or last, and not both. These combinations return an error:
firstandlasttogether.afterandbeforetogether.firstwithbefore.lastwithafter.- A
firstorlastvalue below 1. - Neither
firstnorlast.
Page size
The value of first or last cannot be more than 1000. A larger value returns the error first cannot exceed 1000 or last cannot exceed 1000. The API does not cut the page to 1000 items.
The response
The query returns an AttendeeConnection. See the reference for AttendeeConnection, AttendeeEdge, and PageInfo.
| Field | Description |
|---|---|
edges |
The items of the page, in ascending order of the attendee id. |
edges.cursor |
The cursor of the item. Do not read or change the cursor. Send it back as it is. |
edges.node |
The attendee. |
pageInfo.hasNextPage |
true when more items follow the page. Use it when you read forward. |
pageInfo.endCursor |
The cursor of the last item. Send it as after to read the next page. |
pageInfo.hasPreviousPage |
true when more items come before the page. Use it when you read backward. |
pageInfo.startCursor |
The cursor of the first item. Send it as before to read the page before. |
totalCount |
The number of attendees that match filters. It counts all pages, not only the page that you got. |
When you send after, hasPreviousPage is always true. When you send before, hasNextPage is always true.
Read all pages
This query reads one page of up to 500 attendees. The first request sends null for cursor.
query AttendeesPage($gatheringId: ID!, $cursor: String) {
attendeesConnection(gatheringId: $gatheringId, first: 500, after: $cursor) {
edges {
cursor
node {
id
firstName
lastName
email
}
}
pageInfo {
hasNextPage
endCursor
}
totalCount
}
}
{ "gatheringId": "123", "cursor": null }
The response shows the first page. This example shows two items to keep it short.
{
"data": {
"attendeesConnection": {
"edges": [
{
"cursor": "DaTwn5SRWzEwMV0=",
"node": { "id": "101", "firstName": "Morgan", "lastName": "Hayes", "email": "morgan@example.com" }
},
{
"cursor": "GHzwn5SRWzEwMl0=",
"node": { "id": "102", "firstName": "Jordan", "lastName": "Patel", "email": "jordan@example.com" }
}
],
"pageInfo": {
"hasNextPage": true,
"endCursor": "GHzwn5SRWzEwMl0="
},
"totalCount": 1250
}
}
}
Send the same query again. Put the value of endCursor in cursor.
{ "gatheringId": "123", "cursor": "GHzwn5SRWzEwMl0=" }
Repeat until hasNextPage is false.
Read backward
To read the last items of the list, use last. To read the page before a known item, add before.
query PreviousPage($gatheringId: ID!, $cursor: String) {
attendeesConnection(gatheringId: $gatheringId, last: 100, before: $cursor) {
edges {
node {
id
firstName
lastName
}
}
pageInfo {
hasPreviousPage
startCursor
}
}
}
Filter the list
The filters argument limits the list by the dates on which an attendee was created or changed. See Scalars for the four filter fields.
query RecentAttendees($gatheringId: ID!) {
attendeesConnection(
gatheringId: $gatheringId
first: 500
filters: { updatedAfter: "2026-06-01T00:00:00Z" }
) {
totalCount
pageInfo {
hasNextPage
endCursor
}
}
}
This article is a copy of Pagination in the Touchpoint API documentation.
Comments
0 comments
Please sign in to leave a comment.