Currently, UrlShortener config allows to use URLs based on wikidata.org but not query.wikidata.org. It would be very useful if we could also shorten query URLs, this requires adding query.wikidata.org to whitelisted domains for UrlShortener.
Also, test.wikidata.org is not allowed even on labs, may make sense to add that too for testing purposes. Maybe even *.wikidata.org?