https://github.com/anmonteiro/reason-graphql-experiment
Reason + GraphQL Fullstack (Native) experiment with Now 2.0
https://github.com/anmonteiro/reason-graphql-experiment
Last synced: 9 months ago
JSON representation
Reason + GraphQL Fullstack (Native) experiment with Now 2.0
- Host: GitHub
- URL: https://github.com/anmonteiro/reason-graphql-experiment
- Owner: anmonteiro
- License: mit
- Created: 2018-11-24T00:23:12.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-09T01:30:34.000Z (about 7 years ago)
- Last Synced: 2024-05-22T21:26:45.213Z (over 1 year ago)
- Language: JavaScript
- Size: 5.52 MB
- Stars: 21
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Reason / GraphQL Shared Backend
This is an example of a fullstack Reason + GraphQL application that uses a native
backend and a client compiled to JavaScript through BuckleScript, whilst sharing
types between the backend and the frontend.
## Technologies / Libraries:
This was initially based on [@jaredly](https://github.com/jaredly)'s
[isomagic-todos](https://github.com/jaredly/isomagic-todos) experiment that accomplished
sharing types between the backend & frontend through some PPX magic.
In this case, we leverage the power of GraphQL and its support in OCaml through
[ocaml-graphql-server](https://github.com/andreas/ocaml-graphql-server) and
[graphql_ppx](https://github.com/mhallin/graphql_ppx) to build our API through shared
OCaml / Reason types (have a look in [`src/shared`](./src/shared)).
## Running
### Build the front-end
- `yarn && yarn build`
### Build and run the backend
- `npm install -g esy`
- `esy @server`
- `esy @server x graphql`
## Neat tricks
- GraphQL schema fully defined in Reason (see [`src/server/schema.re`](./src/server/schema.re))
- There's also a GraphiQL instance at `localhost:8080/graphql` for exploring and
playing with the queries and mutations.
## License
MIT