Problem in passing http endpoint queryparameters to app service function

Hi, I am new and trying. Much appreciate your help.
I am working with atlas.free tier, enabled data api.
I created a https endpoint (tsearch) in app services, and attached a function to it.
The function takes arguments; Aim is to pass the query param from the endpoint request to it.

I tried like
exports = async function(query, headers, body){
console.log(query);
doc = context.services
.get(“myClust”)
.db(“mydb”)
.collection(“mycoll”)
.findOne(query );

return doc;
};

testing the function in console with
exports({“hw” : “1” }) returns a document, well.

however, trying the endpoint like
https://txxxxxx.mongodb-api.com/app/data-xxxxx/endpoint/tsearch?hw=1
returns null !?

Can any one please help? TIA.