You can configure a FeatureLayer with a QueryProvider on its LoadingStrategy. For more information, see Dealing with large feature data sets. The FeatureLayer automatically queries for new data when the visible extent of the map changes.

It’s possible that the data that you want to show — and thus the queries you want to use — depend on factors external to the FeatureLayer. For example, a user filters the data through the UI.

In such a case, you need to tell the FeatureLayer to re-query the data. You use the invalidate() method on the QueryProvider for that:

const dataLayer = new FeatureLayer(model);
//...

//Invalidate the QueryProvider to signal that the query has become stale
dataLayer.loadingStrategy.queryProvider.invalidate();

If the new query returns new data for existing Feature instances, you must re-load those Feature instances. See How to query an updated version of existing features for more information.