How can I use pagination at the root of a query in GraphQL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2019
11:52 AM
I'm trying to figure out this new-fangled GraphQL API with hopes of speeding up a few of our slower REST API queries. I'd like to get a list of all courses for a given account (including sub-accounts), but I'm not sure how to create that query using pagination on the allCourses endpoint. I've tried this in GraphiQL:
query MyQuery {
allCourses {
_id
name
createdAt
}
}
And I get the first 10 entries. But if I try:
query MyQuery {
allCourses(start: 20) {...}
}
This gives me an error, saying "Unknown argument 'start'".
What am I missing? How do you do pagination for allCourses?
Thanks in advance for any help.