QueryTask no longer working with implicitly typed Query object in version 4.12

447
7
07-11-2019 08:16 AM
JackFairfield
Occasional Contributor II

In the latest version of the ArcGIS API for JavaScript (4.12), the QueryTask function doesn't seem to be working as expected anymore.

I am getting the following error:

I discovered that if I create a new instance of a Query, it works, but when trying to autocast using a simple object for the query, it doesn't work.

Here is a simple example that demonstrates the problem that I am seeing:

JS Bin example 

Notes: that when you switch the script reference back to 4.11 from 4.12, the QueryTask works as expected.

I would prefer to use autocasting for my queries going forward.  Please let me know if I am doing something wrong.

0 Kudos
7 Replies
BenElan
Esri Contributor

Can you clone the JSBin and show it working when you create a new query instance, then I'll log a bug.

0 Kudos
JackFairfield
Occasional Contributor II

Here is a JSBin using a new query instance.  Works fine.

https://jsbin.com/nebeceziyo/1/edit?js,output

Thanks for logging this for me.

0 Kudos
BenElan
Esri Contributor

Hi Jack,

I have logged a bug for this issue: BUG-000123651

Thanks for the find.

JackFairfield
Occasional Contributor II

Do you have an approximate timeline for this bug fix?

0 Kudos
BenElan
Esri Contributor

You can follow the status of the bug here: https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEyMzY1MQ==

0 Kudos
JohnGrayson
Esri Regular Contributor

A workaround would be to not use outFields:["*"] and instead explicitly set the outFields to only the needed fields, for example: outFields: ["MTN_PEAK","RANK"]

0 Kudos
JackFairfield
Occasional Contributor II

This has been resolved in the 4.13 version of the api.  Thank you.