Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you use it? #12

Closed
matzero opened this issue May 4, 2019 · 4 comments
Closed

How do you use it? #12

matzero opened this issue May 4, 2019 · 4 comments
Labels
examples issues related to examples

Comments

@matzero
Copy link

matzero commented May 4, 2019

I've clone it compile it, run the tests, now how do I run the server?

@sikanhe
Copy link
Owner

sikanhe commented May 8, 2019

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.

@sikanhe
Copy link
Owner

sikanhe commented May 12, 2019

@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 sikanhe added the examples issues related to examples label May 12, 2019
@matzero
Copy link
Author

matzero commented May 13, 2019

@sikanhe this is great! Let me take a gander later on this week and I will report back.

@sikanhe
Copy link
Owner

sikanhe commented May 28, 2019

We have a more full example now at https://github.com/sikanhe/reason-graphql/tree/master/examples/starwars-api

@sikanhe sikanhe closed this as completed Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples issues related to examples
Projects
None yet
Development

No branches or pull requests

2 participants