GraphiQL middleware for express. Initial code is extracted from Apollo server v1.
Add to your project
yarn add express-graphiql-middleware
# or (using npm)
npm i --save express-graphiql-middleware
import expressGraphiqlMiddleware from 'express-graphiql-middleware';
// ... app is express application
app.get('/graphiql', expressGraphiqlMiddleware({ endpointURL: '/graphql', rewriteURL: true }));