cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Technopedia V2 API limiting results

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?

(1) Solution

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

View solution in original post

(2) Replies

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

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.