graphql / express-graphql

Create a GraphQL HTTP server with Express.
MIT License
6.34k stars 538 forks source link

Is it possible to render graphiql documentation explorer on a separated page? #574

Open yarick123 opened 4 years ago

yarick123 commented 4 years ago

Is it possible to render the graphiql documentation on a separated web page? Just the same, what makes graphiql, but without the possibility to send / explore GraphQL queries.

The reason is, that our graph(i)ql end points need special authentication. For the access to the documentation we do not need it.

acao commented 4 years ago

if you want, you can follow the official graphiql examples for other ways of loading graphiql. implementing a special auth flow is as easy as passing in the fetcher function prop with headers/cookies you need. then with your http server you can serve all of this from a static html file, so you can choose whatever route you like and customize graphiql however you like! we will ship a generic middleware to be used in express/etc soon too, but for now it's common for folks to roll their own implementations. Id suggest the webpack + react route if its going to be widely used or customer facing

yarick123 commented 4 years ago

Thank for the answer. I hoped, that this functionality could be easily reused...

acao commented 4 years ago

@yarick123 it will soon, I promise!

acao commented 4 years ago

would you mind if i turn this into a feature request and keep it open?

yarick123 commented 4 years ago

@acao of course I do not mind.

enisdenjo commented 1 year ago

This library has been deprecated and this repo will be archived soon. It has been superseded by graphql-http.

Furthermore, if you seek a fully-featured, well-maintained and performant server - I heavily recommend GraphQL Yoga!