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.

However, it is possible that the data that you want to show — and therefore the queries you want to use — depends on factors that are external to the FeatureLayer. For example, some UI elements allow the user to filter the data as well.

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, those Feature instances must be reloaded. See How to query an updated version of existing features for more information.