Skip to content

Releases: mrspartak/hasura-om

Can update parameters

29 May 19:09
Compare
Choose a tag to compare
orm.updateParams({
  jwt: 'new jwt'
})

JWT auth support

29 May 18:48
Compare
Choose a tag to compare

This was added to support front-end projects with a bundler. But of course, table autogen will not work

const orm = new Hasura({
  graphqlUrl: process.env.GQL_ENDPOINT,
  jwt: process.env.JWT_TOKEN,
});

orm.createTable({name: '_om_test'})
  .createField({name: 'id', isPrimary: true})
  .createField({name: 'text'})
  .createField({name: 'increment'})
  .createField({name: 'type'})
  .generateBaseFragments();

Critical dependency

29 May 05:55
Compare
Choose a tag to compare

graphql is critical, so the module subscriptions-transport-ws will not work without it

getFirst query modifier

28 May 18:33
Compare
Choose a tag to compare

This query modifier allows you to return the first element of the response array. Very useful, if you select/insert/update only one row, and will get the returning object

let [error, response] = await orm.query({
    user: {
        where: { id: { _eq: 23 } }
    }
}, { getFirst: true })
/* 
response = {
    ...userFields
}
*/

One more try to release

28 May 17:25
Compare
Choose a tag to compare

I hate GhA workflow configs

Fixing release GhA workflow

28 May 17:21
Compare
Choose a tag to compare
1.0.1

Readme + workflow fix

Finally a release

28 May 17:15
Compare
Choose a tag to compare

This is the first working release.
A lot of things are to be done later. But the current version is working fine on a server and has a proper documentation

Event emitter for WS connection

26 May 19:29
Compare
Choose a tag to compare
Pre-release

So now you can track all events for debugging

const { Hasura } = require('hasura-om')

let orm = new Hasura({
  graphqlUrl: '',
  adminSecret: ''
})
await orm.init()

let unsub = await orm.subscribe({
    _om_test: {
        aggregate: {
            count: {}
        }
    },
}, ([err, data]) => {
        console.log('sub.data', err, data)  
})

let tsStart = new Date().getTime()
let timediff = function () {
    return `+${ ((new Date().getTime() - tsStart)/1000).toFixed(2) }s`
}
orm.$ws.on('connected', () => {
    console.log(timediff(), 'orm.$ws.on.connected')
})
orm.$ws.on('connecting', () => {
    console.log(timediff(), 'orm.$ws.on.connecting')
})
orm.$ws.on('reconnected', () => {
    console.log(timediff(), 'orm.$ws.on.reconnected')
})
orm.$ws.on('reconnecting', () => {
    console.log(timediff(), 'orm.$ws.on.reconnecting')
})
orm.$ws.on('disconnected', () => {
    console.log(timediff(), 'orm.$ws.on.disconnected')
})
orm.$ws.on('error', (data) => {
    console.log(timediff(), 'orm.$ws.on.error', data)
})

Just pushing a link to docs

26 May 18:14
Compare
Choose a tag to compare
Pre-release

Docs are still not fully written, but the link will not change

Bump new realese with fixed test from 0.0.15

25 May 08:42
Compare
Choose a tag to compare
0.0.16

Try to clear in after hook