Is it possible to display coded domain values (the text, not the numbers) in a popupTemplate for the features returned in a FeatureSet from a QueryTask? Or somehow get the domain values prior to performing the query?
I think its possible to use the CodedValueDomain layer support class to do this: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.h...
There seems to be an excellent example posted here: https://community.esri.com/t5/arcgis-api-for-javascript-questions/js-api-4-16-coded-domain-values-wi...
I hope this helps