I’m checking out Moralis for the first time today. Saw a few of the tutorials and read the documentation. Currently, I’m trying to query the Roles (_Role) but all I get is an empty array.
const { fetch: getStaffRole } = useMoralisQuery('_Role');
async function Check() {
const q = new Moralis.Query('_Role');
const r = await q.first();
console.log('w functions:', r); //returns undefined
const r2 = await getStaffRole();
console.log('w hooks:', r2); //returns Array []
}
Code snippet of the query, Stack doesn't allow me to directly upload the image here.
You need to specify Moralis.Role and to add userMasterKey