Skip to main content
All CollectionsIntegrationsGraphQL
How to build queries using the PlusPlus GraphQL API
How to build queries using the PlusPlus GraphQL API

See basic query examples including filters and pagination

Michael Wallace avatar
Written by Michael Wallace
Updated this week

Basic Query

All queries must provide either a first or a last filter. These will be used to limit the number of items returned. The maximum amount of items that can be returned in a single query is 300.

Listing pk, name and presenters of the first 15 events:

query {
events (first:15) {
edges {
node {
pk
name
presenters {
edges {
node {
pk
name
}
}
}
}
}
}
}

Filtering

It's possible to filter results. Different entities have different filters available.

Filtering the last 10 events that have the word "onboarding" on the name:

query {
events (last:10, name: "onboarding") {
edges {
node {
pk
name
}
}
}
}

Listing pk, name and start date of the first 5 events of 2020:

query {
events (first:5, starts_at_after: "2020-01-01T00:00:00") {
edges {
node {
pk
name
starts_at
}
}
}
}

Paginating

To fetch more than 300 items, pagination is needed. This is done using the startCursor and endCursor values. Those are both available in the pageInfo object.

Returning the cursor to be used when fetching the next page of items:

query {
events (first:5) {
pageInfo {
# The code returned here should be used in the "after" filter.
# See the example below.
endCursor
}
edges {
node {
pk
}
}
}
}

Using the endCursor value to fetch the next page of items:

query {
events (first:5, after: "YXJyYXljb25uZWN0aW9uOjQ=") {
pageInfo {
endCursor
}
edges {
node {
pk
}
}
}
}

See also

Did this answer your question?