graphql-function

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i graphql-function

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • tjmehta