Depends on D18968. Ref T13049. Currently, if you visit /query/?param=value, there is no queryKey for the page but we build a query later on.
Right now, we incorrectly link to /query/all/export/ in this case (and export too many results), but we should actually link to /query/<constructed query key>/export/ to export only the desired/previewed results.
Swap the logic around a little bit so we look at the query we're actually executing, not the original URI, to figure out the query key we should use when building the link.