How do you use it?
matzero opened this issue · comments
I've clone it compile it, run the tests, now how do I run the server?
Hey @matzero I am creating an example repository soon with a server example. Stay tuned. The TLDR is that you have to parse the post request into query
string and variables
(using https://github.com/sikanhe/reason-graphql/blob/master/src/Graphql_Json.re#L24) and pass it to the schema.
@matzero Just released a (experimental) middleware package for bs-express
. You can check out the usage here: https://github.com/sikanhe/reason-graphql/blob/master/reason-graphql-bs-express/examples/server.re
If you want to run it on your own server implementation you can peek into the package to see how I parsed the request body to feed it to the graphql server execution function.
To make it work you would want to install reason-graphql
and reason-graphql-bs-express
at latest versions.
@sikanhe this is great! Let me take a gander later on this week and I will report back.
We have a more full example now at https://github.com/sikanhe/reason-graphql/tree/master/examples/starwars-api