ql-schema-middleware

1.0.0 • Public • Published

ql-schema-middleware

A middleware for generating your GraphQL schema.json file for relay.

"Inspired" by this script: relay-starter-kit/scripts/updateSchema.js.

Installation

Use npm.

npm install ql-schema-middleware

Usage

Use with express:

import {
  graphql
  GraphQLSchema,
} from 'graphql';
import express from 'express';
import qlSchemaMiddleware from 'ql-schema-middleware';

const schema = new GraphQLSchema({
  query: ...
});
const server = express();

server.use('/schema', qlSchemaMiddleware(graphql, schema));

server.listen(3000);
console.log(`Alive and well on port: 3000`);

Or curl & pipe to a file:

curl http://localhost:3000/schema -o schema.json

Readme

Keywords

Package Sidebar

Install

npm i ql-schema-middleware

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • romellogood