When querying a service through the REST endpoint in ArcGIS Online and specifying a geometry, the GeoJSON output is empty even when other formats return results with the same parameters.
Tested on the latest version of ArcGIS Online and works as expected.
Make sure to input the correct format of geometry if the query needs to be based on an envelope.
For instance:
{"xmin":-8942520.813153777,"ymin":5381166.791295588,"xmax":-8932736.873533288,"ymax":5390950.730916077,"spatialReference":{"wkid":102100,"latestWkid":3857}}
For more query parameter information, please read the following document:
https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm