Skip to content

A ThinkJS middleware that handles GraphQL queries, built atop apollo-server-core

Notifications You must be signed in to change notification settings

NimitzDEV/think-graphql-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

think-graphql-middleware

A ThinkJS middleware that handles GraphQL queries, built atop apollo-server-core.

Install

npm install think-graphql-middleware --save

Usage

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.

About

A ThinkJS middleware that handles GraphQL queries, built atop apollo-server-core

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published