https://github.com/ashinga48/lambda-graphql-bff
https://github.com/ashinga48/lambda-graphql-bff
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ashinga48/lambda-graphql-bff
- Owner: ashinga48
- Created: 2021-10-11T04:15:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-15T06:57:04.000Z (over 3 years ago)
- Last Synced: 2025-01-27T06:18:48.101Z (4 months ago)
- Language: JavaScript
- Size: 164 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BFF Graphql API
Graphql + Express setup
Gitlab CI ready
# DEVELOPMENT
### Install & Runthis uses `index.js` at the root to run a local graphql server
```
npm install
npm start // this runs the local development server
```### Playground help for sample api
```
--- SignUp User ---
mutation signupUser {
signupUser( name: "my user", email: "[email protected]", password: "password") {
token
}
}---- Login User ----
mutation loginUser {
loginUser( email: "[email protected]", password: "password") {
token,
error
}
}---- verify Token ----
mutation verifyToken {
verifyToken(token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGVzdCBVc2VyIDEiLCJlbWFpbCI6InRlc3RpbmdAZ21haWwuY29tIiwicGFzc3dvcmQiOiIkMmIkMDQkWEdiYjF3aG40aHBIL0FrRUFJSEN5TzVhalpPMU4yeGdRT3J3L2ozTDdXaXYwa1NvdXhjc0ciLCJpZCI6MTAwLCJpYXQiOjE1ODU0ODcwMDB9.C9ezWI15HNsZAD68us6lL31DdsPFPJ5Xnh9tnb5duFw") {
name,
email,
id
}
}---- Query Users ----
{
users {
id
}
userById(id: 34) {
name
}
}
```# DEPLOYMENT
this uses `deploy.js` at the root of the folder
In your CI
- install aws cli
install serverless globally
```
npm install -g serverless
```Deploy using serverless
```
serverless deploy --stage dev
or
serverless deploy --stage prod
```