https://github.com/konsumer/graphql-now-builder
Quickly build a graphql server on now.sh, from a simple config file.
https://github.com/konsumer/graphql-now-builder
Last synced: about 1 year ago
JSON representation
Quickly build a graphql server on now.sh, from a simple config file.
- Host: GitHub
- URL: https://github.com/konsumer/graphql-now-builder
- Owner: konsumer
- Created: 2019-02-06T01:26:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-04T20:48:30.000Z (about 7 years ago)
- Last Synced: 2025-02-13T16:22:48.320Z (over 1 year ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# graphql-now-builder
a [now builder](https://zeit.co/docs/v2/deployments/builders/overview/) for graphql services
## usage
create an `index.js` file
```js
module.exports = {
typeDefs: `
type Query {
hello: String
}
`,
resolvers: {
Query: {
hello: () => `hello world`
}
}
// any other apollo-server config
}
```
where `typeDefs` is a string that decscribes your schema, then create a `now.json` file
```json
{
"version": 2,
"builds": [
{ "src": "index.js", "use": "graphql-now-builder" }
],
"routes": [
{ "src": "/graphql", "dest": "index.js" }
]
}
```
then run `now` to deploy with [now](https://now.sh/).
Since you can use any [apollo-server](https://www.apollographql.com/docs/apollo-server/api/apollo-server.html) config, feel free to use `schema` or anything else you might do with that.
The default path is `/graphql`, but you can change that by adding `path` to your server, and updating your route in `now.json` to point to it.