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

[Feature Request] Expose the Dataloader API options

Open elbasan opened this issue 3 years ago • 0 comments

We recently had this issue where the CosmosDB query length limit exceeded.

To fix this, we had to write our own wrapper to set the maxBatchSize option to limit the number of request that get queued into one batch request, as we currently can't set this option in apollo-datasource-cosmosdb.

Is it possible to add the ability to set the Dataloader options?

For example:

class Data extends CosmosDataSource<Container, ApolloContext> {

  constructor(container: Container, options: CosmosDataSourceOptions) {
    super(container, options);

    this.options.dataloader = {
      maxBatchSize: 1000,
      ... // other Dataloader options https://github.com/graphql/dataloader#class-dataloader
    }
  }

}

elbasan avatar Feb 21 '22 13:02 elbasan