1.0.1 • Published 7 years ago

graphql-function v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

graphql-function Build Status js-standard-style

GraphQL Function Type

Installation

npm i --save graphql-function

Usage

var GraphQLFunction = require('graphql-function')

// Use graphql-function in your GraphQL objects for Function properties
var fooType = new GraphQLObjectType({
  name: 'Foo',
  description: 'Some foo function',
  fields: {
    add: {
      function: GraphQLFunction,
      description: 'Function that adds two numbers'
    },
  }
});

var queryType = new GraphQLObjectType({
  name: 'Query',
  fields: {
    foo: {
      function: fooType,
      resolve: function () {
        // ...
      },
    },
  }
})

License

MIT