Factored out how query args are constructed when fetching all keys.