Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

88
Views
How to query Moralis roles with React?

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.

—> Table permissions, table, & console logs

7 months ago · Juan Pablo Isaza
Answer question
Find remote jobs