Skip to content
Express GraphQL Server with Validation Caching and graphql-jit
TypeScript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src operationName can be null Jan 10, 2020
.gitignore initial commit Jan 9, 2020
LICENSE
README.md Update README.md Jan 9, 2020
package.json
tsconfig.json initial commit Jan 9, 2020
yarn.lock initial commit Jan 9, 2020

README.md

express-gql

This is a mix between fastify-gql and graphql-api-koa for Express.

Why

I wanted to use fastify-gql but I relied on some Express middleware, so I took the GraphQL caching techniques used in fastify-gql and copied them into some express middleware.

Setup

yarn add express-gql

Usage

const bodyParser = require("body-parser");
const { createGraphqlMiddleware } = require("express-gql");
const express = require("express");
const schema = require('./schema');

const app = express();

app.post(
  "/graphql",
  bodyParser.json(),
  createGraphqlMiddleware({
    context: ({ req, res }) => ({}),
    formatError: ({ req, error }) => error,
    schema
  })
);
You can’t perform that action at this time.