Update the query when updating the selection.

The component updates its query whenever the selection changes. However,
after a user edits the query and select the same selection, query does not
get updated, as selection is not changed.