Is anyone using GraphQL with http4k? Have you inte...
# http4k
Is anyone using GraphQL with http4k? Have you integrated it successfully with the `Request`/`Response` flow that http4k servers/clients use?
I've seen so far which looks like it could be useful
I’ve used graphql-java + http4k in a side project once. There’s a bit of glue code that you have to write, but it’s pretty straghtforward otherwise.
Integrating it with http4k is very straightforward
A graphql endpoint takes a plain ol’ JSON request, and returns a plain ol’ JSON response.
The cookbook example for defining json endpoints in http4k was more than sufficient.
@yen that's great to hear that it was simple! Is that side project anywhere public that we can see it? Would love to see how you integrated and if there's anything we can do to provide tools/patterns/a new module for others to reuse. (No worries if not of course 🙃)
My project isn’t open-source unfortunately. I can point you to the GraphQL docs, which outline the shape of the POST request: The only thing I used http4k for is to extract the fields, and pass them along into graphql-java’s execution engine
I added a graphql api next to a rest api just to try it out. I actually never used graphql before this, so could really bad:
so yeah that is with the KGraphQL mentioned above