Middleware for serving GraphiQL.
Works with Express and any other server that supports middleware of the format (_, {set, send}) => ()
graphiqlMiddleware(options, props)
Where options
are:
- endpointURL
And props
are serializable GraphiQL component props.
import { graphiqlMiddleware } from 'graphiql-middleware';
app.use(
'/graphiql',
graphiqlMiddleware({
endpointURL: '/graphql',
}, {
headerEditorEnabled: true,
shouldPersistHeaders: true
})),
);