GraphQL Function Type
npm i --save graphql-function
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 () {
// ...
},
},
}
})
MIT