Hasura ORM
Fragment oriented Hasura ORM for backends with many stuff "from the box"
npm i hasura-om
const { Hasura } = require('hasura-om')
const orm = new Hasura({
graphqlUrl: 'your hasura endpoint',
adminSecret: 'your hasura admin secret'
})
await orm.generateTablesFromAPI()
let [err, result] = await orm.query({
user: {
where: { is_live: { _eq: true } },
limit: 10,
order_by: { rating: 'desc' }
},
pets: {
select: {
where: { type: { _eq: 'dog' } }
},
aggregate: {
count: {},
avg: ['age']
}
}
})