Guys, any idea how I could embed GraphQL Playgroun...
# prisma-whats-new
r
Guys, any idea how I could embed GraphQL Playground (https://github.com/graphcool/graphql-playground/) into our Golang API server without any extra server? Currently I've got an embedded GraphiQL webapp served by the debug version of the API server which is directly embedded into the servers code as a source-file-string with CDN links, is the same possible with GraphQL Playground?
a
One approach would be to deploy it standalone and use your GraphQL API endpoint in it.
r
That's one way, though I'd like to have it served by the debug-build of the API server to not have to "configure" your development environment as an API developer or rely on any service in the network.. The idea of serving the app straight from the API server seems very compelling
I could just as well use the electron app in that case, but as I said - having it all in one executable would be nice to have
h
So you want how yoga is doing it?
r
@huv1k not sure what you mean, could you please explain in a little more detail?
h
graphql-yoga
have on route
/
playground
so when you go to this route you have access to playground
But best option is ask tim 🙂
But i think you can get it working when you create your custom html and setup everything needed inside 🙂
r
Copy code
graphql-yoga
is a JavaScript based server, there shouldn't be any problem embedding a webapp there in our case it's a compiled golang server, which just has a .go file with a byte slice of the source code of graphiql with CDN link in it.. it wouldn't work here
in this case it's probably better to remove it from the server entirely and use the electron apps instead
h
You can still have one endpoint in go server, what serves playground, with your custom html
r
okay, I'll try, thanks!