express-graphql icon indicating copy to clipboard operation
express-graphql copied to clipboard

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

Open yarick123 opened this issue 4 years ago • 6 comments

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.

yarick123 avatar Nov 15 '19 10:11 yarick123

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

acao avatar Nov 28 '19 18:11 acao

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

yarick123 avatar Nov 30 '19 15:11 yarick123

@yarick123 it will soon, I promise!

acao avatar Nov 30 '19 17:11 acao

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

acao avatar Nov 30 '19 17:11 acao

@acao of course I do not mind.

yarick123 avatar Nov 30 '19 17:11 yarick123

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!

enisdenjo avatar Mar 20 '23 12:03 enisdenjo