https://github.com/benbowes/serverless-nodejs-graphql-test
https://github.com/benbowes/serverless-nodejs-graphql-test
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/benbowes/serverless-nodejs-graphql-test
- Owner: benbowes
- License: mit
- Created: 2020-05-26T08:22:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T23:36:42.000Z (over 3 years ago)
- Last Synced: 2024-10-05T14:23:30.778Z (almost 2 years ago)
- Language: JavaScript
- Homepage: https://mpb76lfdbj.execute-api.ap-southeast-2.amazonaws.com/dev/
- Size: 978 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# serverless-nodejs-graphql-test
## A serverless GraphQL AWS lambda endpoint
#### Some example queries
Note: `start` is zero based, whereas `count` is not zero based
## Getting started locally
`npm i && npm run dev`
```
// Request a fragment of products
query {
product(start:10, count: 10) {
totalResults
start
count
products {
id
color
name
price
}
}
}
// Returns the 2nd product, through to the 11th product
```
```
// Request one product
query {
product(id: "7") {
totalResults
start
count
products {
id
color
name
price
}
}
}
// Returns the product that matches the id
```
```
// Request via serach term
query {
product(searchTerm: "chair", start: 3, count: 10) {
totalResults
start
count
products {
id
color
name
price
}
}
}
// Returns the products that matches on color or name begining at the 3rd result, up to ten results
```
```
// Request all products
query {
product {
totalResults
start
count
products {
id
color
name
price
}
}
}
// Returns all products
```