graphql-function

GraphQL Function Type


Keywords
graphql, function, type, functiontype
License
MIT
Install
npm install graphql-function@1.0.1

Documentation

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