Skip to content

Aggregate, pk fragment and flat for all queries

Pre-release
Pre-release
Compare
Choose a tag to compare
@mrspartak mrspartak released this 22 May 14:53
· 128 commits to master since this release

So queries are select by default, but you can aggregate now

orm.query({
  aggregate: {
     count
  }
})
//response.count

I added pk fragment, that contents only a primary keys and also flat works for mutations too now

orm.mutate({
  user: {
    insert: {
       object: {...newUser},
       fragment: 'pk'
    }
  }
})
//response[0].id

Global flat settings are at Hasura constructor now:

const orm = new Hasura({
   ...settings,
   query: {
    flatOne: false
  }
})