Skip to content

Pass hasura session vars to query/mutation

Compare
Choose a tag to compare
@mrspartak mrspartak released this 03 Jun 07:06
· 84 commits to master since this release

This release allows you to pass headers to special requests. For example if you want to check user's permissions etc.

orm.query({
  message: {
    insert: {
      objects: {
        chat_id: 1,
        message: 'hey'
      }
    }
  }
}, { getFirst: true }, {
  headers: {
    'X-Hasura-User-ID': 1,
    'X-Hasura-Role': 'user',
  }
})