1.0.0 • Published 7 years ago
think-graphql-middleware v1.0.0
think-graphql-middleware
A ThinkJS middleware that handles GraphQL queries, built atop apollo-server-core.
Install
npm install think-graphql-middleware --saveUsage
Require the middleware at src/config/middleware.js
const graphql = require('think-graphql-middleware');Set-up match for your desired GraphQL endpoint, and use graphql for handle parameter.
{
match: '/graphql',
handle: graphql,
options: {}
}Then pass your GraphQLSchemainstance to schema option.
options: {
schema: schemaInstant
}More details
This middleware is based on apollo-server-core, more usages can be found at the Apollo Official Site.
1.0.0
7 years ago