Skip to content

Fragments extension

Pre-release
Pre-release
Compare
Choose a tag to compare
@mrspartak mrspartak released this 17 May 21:35
· 139 commits to master since this release

An example from Readme

let baseUserFragment = orm.table('user').fragment('base')
let basePostFragment = orm.table('post').fragment('base')

orm.table('user').createFragment('some_unique_name', [
    baseUserFragment.gqlFields(),
    {
        key: 'posts',
        values: [
            basePostFragment.gqlFields(),
        ]
    }
])

/*
This will create schema with all base user and posts fields
{
  ...userfields
  posts {
    ...postsfields
  }
}
*/