message: indexer-agent: Paginate query for subgraph deployments
  The query for subgraph deployments used to determine which are worth
  indexing was subject to timing out due to its complexity. This change
  paginates the query rather than taking the first 1000. This has the
  added benefit of reducing the possibility of missing deployments.
diff: @@ -350,36 +350,56 @@ export class Network {
  rule => rule.deployment === INDEXING_RULE_GLOBAL,
  )
  + const deployments = []
  + const queryProgress = {
  + lastId: '',
  + first: 10,
  + fetched: 0,
  + exhausted: false,
  + retriesRemaining: 10,
  + }
  +
  + while (!queryProgress.exhausted) {
  + this.logger.debug(`Query subgraph deployments`, {
  + queryProgress: queryProgress,
  + })
  try {
  - // TODO: Paginate here to not miss any deployments
  const result = await this.networkSubgraph.query(
  gql`
  - query {
  - subgraphDeployments(first: 1000) {
  + query subgraphDeployments($first: Int!, $lastId: String!) {
  + subgraphDeployments(
  + where: { id_gt: $lastId }
  + orderBy: id
  + orderDirection: asc
  + first: $first
  + ) {
  id
  stakedTokens
  signalAmount
  - signalledTokens
  - indexingRewardAmount
  queryFeesAmount
  indexerAllocations {
  indexer {
  id
  }
  - allocatedTokens
  - queryFeesCollected
  }
  }
  }
  `,
  + { first: queryProgress.first, lastId: queryProgress.lastId },
  )
  if (result.error) {
  throw result.error
  }
  - return (
  - result.data.subgraphDeployments
  + const results = result.data.subgraphDeployments
  +
  + queryProgress.exhausted = results.length < queryProgress.first
  + queryProgress.fetched += results.length
  + queryProgress.lastId = results[results.length - 1].id
  +
  + deployments.push(
  + ...results
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  .filter((deployment: any) => {
  const deploymentRule =
  @@ -463,16 +483,29 @@ export class Network {
  }
  })
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  - .map((deployment: any) => new SubgraphDeploymentID(deployment.id))
  + .map((deployment: any) => new SubgraphDeploymentID(deployment.id)),
  )
  } catch (error) {
  + queryProgress.retriesRemaining--
  + this.logger.error(`Failed to query subgraph deployments`, {
  + retriesRemaining: queryProgress.retriesRemaining,
  + error: error,
  + })
  + if (queryProgress.retriesRemaining <= 0) {
  const err = indexerError(IndexerErrorCode.IE009, error)
  - this.logger.error(`Failed to query subgraph deployments worth indexing`, {
  + this.logger.error(
  + `Failed to query subgraph deployments worth indexing`,
  + {
  err,
  - })
  + },
  + )
  throw err
  }
  }
  + }
  +
  + return deployments
  + }
  async allocations(status: AllocationStatus): Promise<Allocation[]> {
  try {
  