UNPKG

mgs-graphql

Version:

The simple way to generates GraphQL schemas and Sequelize models from your models definition,microservice supported

17 lines (14 loc) 371 B
// @flow const {graphql} = require('graphql') const schema = require('./schema') module.exports = class GraphQLExec { rootValue context constructor (context:Object = {}) { this.rootValue = {} this.context = context } async exec (query, variables = {}) { return graphql(schema, query, this.rootValue, this.context, variables) } }