React-Moralis, useMoralisCloudFunction hook issue

Here is my Moralis cloud function,

Moralis.Cloud.define("getUserInfo", async (request) => {
    const query = new Moralis.Query("_User", { useMasterKey: true });
    query.equalTo("accounts", request.params.ethAddress)
    const results = await query.find({ useMasterKey: true });
    return results;
});

When I call this cloud function using REST API,

let res = await axios.get(`https://jwwwh627aofffusemoralis.com:2053/server/functions/getUserInfo?_ApplicationId=iHfefwR5At8M27mMgdMxsgrd0izH5qx2F7wHVl&ethAddress=${params.ethAddress}`);
console.log("res", res.data);

Here is the response,

image

But, when I call this cloud using useMoralisCloudFunction hook,

const params = { ethAddress: "0x5F8eac3eAeb7F32320ddb9B4433edD7A346d61065" };

const { fetch: getUserInfo } = useMoralisCloudFunction("getUserInfo", params, { autoFetch: false });

let userInfo = await getUserInfo();
console.log("userInfo", userInfo);

Here is the response,

image

Can anyone explain why this happens?

You could do something like:

const userInfo = useMoralisCloudFunction("getUserInfo", params, { autoFetch: false });

...

const user = await userInfo.fetch();
console.log('userInfo', user);

Not working. still, the same issue.

I see, could you test it with this query which returns all users - this works fine for me.

Moralis.Cloud.define("getUsers", async (request) => {
    const query = new Moralis.Query("_User", { useMasterKey: true });
    const results = await query.find({ useMasterKey: true });
    return results;
});