https://github.com/zackify/reason-apollo-server
Set of bindings for Apollo Server in ReasonML
https://github.com/zackify/reason-apollo-server
Last synced: 7 months ago
JSON representation
Set of bindings for Apollo Server in ReasonML
- Host: GitHub
- URL: https://github.com/zackify/reason-apollo-server
- Owner: zackify
- Created: 2018-01-25T01:15:08.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-25T02:25:17.000Z (about 8 years ago)
- Last Synced: 2025-02-14T04:49:42.664Z (about 1 year ago)
- Language: OCaml
- Size: 9.77 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Install
```
npm install --save graphql reason-apollo-server
```
Add
```
"bs-dependencies": [
"reason-apollo-server",
]
```
to `bsconfig.json`
## Usage
`Schema.re`
```
let typeDefs = {|
type Query {
user(id: Int!): User
}
type User {
name: string
}
|};
let Query = {
user: (_: GQL.root, {id: int}) => { id, name: "Test"}
};
let schema = GQL.makeExecutableSchema({ typeDefs, resolvers: { Query }})
```
Now import `./src/Schema.bs.js` into express like the example folder shows and you're good to go!