https://github.com/phrase/sls-gql-example
https://github.com/phrase/sls-gql-example
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/phrase/sls-gql-example
- Owner: phrase
- Created: 2019-05-14T08:30:26.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T01:06:13.000Z (over 3 years ago)
- Last Synced: 2025-02-06T07:13:11.966Z (over 1 year ago)
- Language: Go
- Size: 9.77 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sls-gql
Example to use GraphQL as an API for AWS Lambda.
## Setup
* Install go-bindata from https://github.com/go-bindata/go-bindata
* Install serverless framework: `yarn global add yarn` or `npm install -g serverless`
* make sure you have AWS credentials (e.g. `AWS_ACCESS_KEY_ID`,
`AWS_SECRET_ACCESS_KEY`) in your ENV.
* `make deploy`
## Schema Updates
The schema can be found at `graphql/schema.gql` but in the code the inlined
version is used (via go-bindata). When you update the schema you also need to
either run `make schemagen` or `go generate ./...`.
## Execute query via invoke
### Without variables
sls invoke -f graphql --data '{"query":"query { hello } "}'
### With variables
```
sls invoke -f graphql <