threshold-network / merkle-distribution

Threshold Network rewards generation and distribution
https://threshold.network
1 stars 6 forks source link

Use pagination in GraphQL queries #23

Closed manumonti closed 1 year ago

manumonti commented 2 years ago

The maximum amount of elements that a subgraph allows to be retrieved in a single query is 1000.

Since at the beginning of the Threshold Network subgraph, the number of events and GraphQL elements is low, this limit of 1000 is enough to run the queries. Despite this, the number of events and, therefore, the number of elements is growing. So it's necessary to introduce pagination in the GraphQL queries.

https://github.com/threshold-network/merkle-distribution/blob/8e049a2df653898d4d15689385a757bcf822d350/src/stakingrewards/stakingrewards.js#L42-L44