Skip to content

wix-playground/graphql-query-builder

 
 

Repository files navigation

graphql-query-builder

a simple but powerful graphQL query builder

Install

npm install wix-graphql-query-builder

bower install graphql-query-builder

Example

var Query = require('graphql-query-builder');

// example of nesting Querys
/*
{
 user( id:3500401 ) {
    id,
    nickname : name,
    isViewerFriend,

    image: profilePicture( size:50 ) {
        uri,
        width,
        height
    }
  }
}
*/

let profilePicture = new GraphQlQuery('profilePicture', {size: 50})
    .select('uri', 'width', 'height');

let user = new GraphQlQuery('user', {id: 3500401})
    .select('id', {'nickname': 'name'}, 'isViewerFriend', {'image': profilePicture});


console.log('user', user.toString());

About

a simple but powerful graphQL query builder

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 90.4%
  • JavaScript 9.6%