I'm having trouble working with the limiting results feature of the Technopedia V2 API as described here https://developer.flexera.com/docs/api/content/v2#/Technopedia/Technopedia%23graphql
This query works ok:
query { Manufacturer(skip: 9999, take: 1) { name }}
This one fails by hitting the 10000 resource limit:
query { Manufacturer(skip: 10000, take: 1) { name }}
I would have expected the API to filter the results before checking if the limit was reached. Have I misunderstood how to use this dataset limiting feature?
Is there another way to paginate and step through the results in batches?
‎May 01, 2024 07:54 PM
My understanding of the way to use pagination for this api is Cursor based (not limit/next), i.e:
a) Structure the query so it is returning data in the order you want and make sure you include the ID of the object in the results, eg:
query {
Manufacturer(take: 5) {
id,
name
}
}
b) Then use the id in the result set to query the next page of data (using the same query/ordering):
query {
Manufacturer(take: 5, afterId: "<ID OF LAST RECORD>") {
id,
name
}
}
regards,
Murray
‎May 05, 2024 06:36 PM - edited ‎May 06, 2024 02:10 AM
My understanding of the way to use pagination for this api is Cursor based (not limit/next), i.e:
a) Structure the query so it is returning data in the order you want and make sure you include the ID of the object in the results, eg:
query {
Manufacturer(take: 5) {
id,
name
}
}
b) Then use the id in the result set to query the next page of data (using the same query/ordering):
query {
Manufacturer(take: 5, afterId: "<ID OF LAST RECORD>") {
id,
name
}
}
regards,
Murray
‎May 05, 2024 06:36 PM - edited ‎May 06, 2024 02:10 AM
Thanks Murray.
That worked for me. I had mistakenly assumed that skip and take would also work but I understand now those options are only for selecting a subset of records within an ordered result.
‎May 06, 2024 09:25 PM