1.2.0 • Published 5 years ago

graphqlify v1.2.0

Weekly downloads
624
License
MIT
Repository
github
Last release
5 years ago

graphqlify

This module helps you build GraphQL queries using plain JavaScript objects. This can be useful when you need to programmatically build GraphQL queries. Install the module from npm to get started.

npm i -S graphqlify

Example

GraphQL

{
  teamFourStar {
    members {
      memberName
    }
    saiyans: members(type: SAIYAJIN, minPower: 9000) {
      memberName
      powerLevel
    }
  }
}

JavaScript

import graphqlify, {Enum} from 'graphqlify';

const string = graphqlify({
  teamFourStar: {
    fields: {
      members: {
        fields: {memberName: {}}
      },
      saiyans: {
        field: 'members',
        params: {type: Enum('SAIYAJIN'), minPower: 9000},
        fields: {memberName: {}, powerLevel: {}}
      }
    }
  }
});
1.2.0

5 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.3.7

8 years ago

0.3.6

8 years ago

0.3.5

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago