when I call the following function like this:
const data1 = async () => {
const res = await server.fetch({ query: LISTINGS });
return res;
};
console.log(data1());
It's console logging "Promise {<pending}" but when I change it to following function I get the response in console.
const data1 = async () => {
const res = await server.fetch({ query: LISTINGS });
console.log(res);
};
data1();
what's the reason to Promise {<pending} behavior?