romaklimenko / cluedin

CluedIn Python SDK
MIT License
3 stars 0 forks source link

Paged results #5

Closed romaklimenko closed 1 year ago

romaklimenko commented 1 year ago

For search GraphQL queries, implement an iterator (or a generator) to return paged results.

API should be like:

cluedin.gql.entries(context, query, variables)

Inside the entries method, send a GraphQL request, and if there's a cursor and entries in the response, yield the entries and request the same GraphQL but with the cursor this time.

romaklimenko commented 1 year ago

https://github.com/romaklimenko/cluedin/blob/9182cece998f92438ff43d7135478b1625a9a7be/cluedin/tests/test_gql.py#L66-L97