@nanoexpress/middleware-graphql

GraphQL middleware for nanoexpress

Usage no npm install needed!

<script type="module">
  import nanoexpressMiddlewareGraphql from 'https://cdn.skypack.dev/@nanoexpress/middleware-graphql';
</script>

README

graphql

graphql middleware for nanoexpress

Installation

npm i @nanoexpress/middleware-graphql
# or
yarn add @nanoexpress/middleware-graphql

Caveats

  • This middleware provides only HTTP bindings
  • For subscription support, please use graphql-ws

Example

See the examples directory

Usage

ESM Module

import graphql from '@nanoexpress/middleware-graphql';

app.post('/graphql', graphql(GraphQLSchema));

CJS Module

const graphql = require('@nanoexpress/middleware-graphql/cjs');

app.post('/graphql', graphql(GraphQLSchema));

Options

Please refer to here or here for more information

License

MIT