Esri / cedar

JavaScript Charts for ArcGIS
https://esri.github.io/cedar
256 stars 238 forks source link

Allow passing request options to query #482

Closed tomwayson closed 3 years ago

tomwayson commented 3 years ago

I've recently encountered the need to override the request options sent to queryFeatures(), specifically to force using POST instead of GET due to the server's limit on query string length. The problem is that queryDatasets() does not currently allow that.

We could do this in a couple ways. We could either add a requestOptions property to IDataset, or we could have queryDatasets() take an optional second argument like requestOptions?: IRequestOptions) which could be passed in from chart.query() as something like queryDatasets(this.datasets(), this.requestOptions(). We could also ultimately do both of those and have the dataset's options override those of the chart.

I suggest starting by adding the property to IDataset since that is the most granular and offers the most bang for the buck.

benstoltz commented 3 years ago

I think adding it to IDataset first is a good idea. We can then subsequently add it as a optional second argument afterwards if we want.