apollo-datasource-cosmosdb icon indicating copy to clipboard operation
apollo-datasource-cosmosdb copied to clipboard

Setting the MaxItemCount

Open shashankkr opened this issue 2 years ago • 2 comments

Hi @andrejpk , Is there a way to set the MaxItemCount option? I am trying to restrict a response based on the number of items returned in an array and not by its size. More info here https://docs.microsoft.com/en-us/azure/cosmos-db/sql/sql-query-pagination

shashankkr avatar Jul 29 '22 01:07 shashankkr

Is there any update on how this can be achieved?

I'm trying to implement relay-style cursor pagination but can't limit the results because of the findManyByQuery() function calling fetchAll for the query. MaxItemCount doesn't affect the result in the end.

cmarshall10450 avatar Mar 03 '23 19:03 cmarshall10450

That seems really useful and maybe not too hard. I don't think I can put much time into this soon so happy to take a PR if you'd like to take a shot at it. Otherwise I can look into it when I free up a bit.

andrejpk avatar Mar 03 '23 21:03 andrejpk