Hi
For a particular situation, in ArcGIS for JS API 4.15 I am trying to force a particular format of all Feature Server (FS) queries to JSON (f=json, or f=pjson), regardless of the ArcGIS Server's (10.7.1) > Feature Service's > Layer config params, such as SupportedQueryFormats: JSON, GeoJSON, PBF. It looks like PBF is preferred to be used by clients, if it is available.
I have forced f=json with esri.Config.request successfully:
require([
"esri/config",
...
], function(esriConfig,...) {
esriConfig.request.interceptors.push({
before(params) {
if (params.url.includes("query")) {
params.requestOptions.query.f = 'json';
}
}
}
...
});
which works at the call level. However when the query is originally PBF, the client JS SDK is expecting it to come back and be parsed as PBF still, even though I have intercepted the initial request. I know this because the FL does not display on the web map and I get the console error:
dojo-lite.js:261 [esri.tasks.operations.pbfFeatureServiceParser]
- f {name: "query:parsing-pbf", message: "Error while parsing FeatureSet PBF payload", details: {…}}
- details: {error: Error: Invalid data type! at c.skip (https://js.arcgis.com/4.15/dojo/dojo-lite.js:726:180) …}
- message: "Error while parsing FeatureSet PBF payload"
- name: "query:parsing-pbf"
- ...
Is this a bug in ArcGIS for JS API?
Is there a more robust way to change the FS query format from the client?
ArcGIS Enterprise Admin Professional, AWS Solutions Architect Professional