Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware for Express, Koa and Hapi #5

Closed
IvanGoncharov opened this issue Jul 25, 2017 · 2 comments
Closed

Middleware for Express, Koa and Hapi #5

IvanGoncharov opened this issue Jul 25, 2017 · 2 comments

Comments

@IvanGoncharov
Copy link
Member

IvanGoncharov commented Jul 25, 2017

It would be great to plug playground into your server without writing too much boilerplate code.
Middleware solves this problem and enables you to write code like this:

import express from 'express';
import { express as middleware } from 'graphql-playground/middleware';

const app = express();

app.use('/playground', middleware({ endpointUrl: '/graphql' }));

app.listen(3000);

Here is how it is implemented in Voyager:
graphql-kit/graphql-voyager@ba35ed1...96009e8
Almost all the code can be reused for playground with minor changes :)

@pradel
Copy link

pradel commented Jul 27, 2017

@schickling
Copy link
Collaborator

This needs to be revisited before release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants