https://github.com/thiskevinwang/dynamodb-graphql-server
GraphQL + DynamoDB CRUD API 🔗 https://github.com/thiskevinwang/dynamo-next-graphql
https://github.com/thiskevinwang/dynamodb-graphql-server
apollo-server aws dynamodb graphql zeit-now
Last synced: 6 days ago
JSON representation
GraphQL + DynamoDB CRUD API 🔗 https://github.com/thiskevinwang/dynamo-next-graphql
- Host: GitHub
- URL: https://github.com/thiskevinwang/dynamodb-graphql-server
- Owner: thiskevinwang
- Created: 2019-08-10T13:02:52.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-10T03:30:18.000Z (over 5 years ago)
- Last Synced: 2025-03-06T05:41:56.746Z (7 months ago)
- Topics: apollo-server, aws, dynamodb, graphql, zeit-now
- Language: TypeScript
- Homepage: https://dynamodb-graphql-server.now.sh
- Size: 147 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# graphql-server-example
## Getting Started
```bash
git clone https://github.com/thiskevinwang/graphql-server-example.git
cd graphql-server-example
yarn install
yarn run develop# go to localhost:4000
```---
## Education sources
- https://medium.com/@joranquinten/how-to-deploy-a-nodejs-server-on-zeits-now-platform-e713207313d3
### AWS-SDK
- https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#updateTable-property
### Local DynamoDB w/ Docker
- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.Docker.html
- https://hub.docker.com/r/amazon/dynamodb-local```bash
docker pull amazon/dynamodb-local
docker run -p 8000:8000 amazon/dynamodb-local
```### Dynamo Tutorial
Node:
- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.NodeJs.01.html
### DynamoDB Data Model
- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.html
### Cheatsheet
#### CLI Commands
##### Help
```bash
aws dynamodb help
```##### List Tables
```bash
aws dynamodb list-tables help
aws dynamodb list-tables --endpoint-url http://localhost:8081
```##### Scan
```bash
aws dynamodb scan help
aws dynamodb scan --table-name Snacks
```##### Put Item
```bash
aws dynamodb put-item help
aws dynamodb put-item --table-name Snacks --item '{"Id": {"S": "1"}}'
```##### Update Item
```bash
aws dynamodb update-item help# Add / Overwrite Attribute
aws dynamodb update-item \
--table-name Snacks \
--key '{"Id": {"S": "1"}}' \
--attribute-updates '{"MyNewAttributeName": {"Value": {"S":"Poteko"}}}'# Actions --- [ADD, DELETE, PUT]
# Delete Attribute
# - "Value" (not required)
aws dynamodb update-item \
--table-name Snacks \
--key '{"Id": {"S": "1"}}' \
--attribute-updates '{"MyNewAttributeName": {"Action": "DELETE" }}'# Increment/Decrement a "N" Attribute
aws dynamodb update-item \
--table-name Snacks \
--key '{"Id": {"S": "1"}}' \
--attribute-updates \
'{"Count": {"Value": {"N":"0"}}}'aws dynamodb update-item \
--table-name Snacks \
--key '{"Id": {"S": "1"}}' \
--attribute-updates \
'{ "Count": {"Action": "ADD", "Value": {"N":"1"}}}'aws dynamodb update-item \
--table-name Snacks \
--key '{"Id": {"S": "1"}}' \
--attribute-updates \
'{ "Count": {"Action": "ADD", "Value": {"N":"-1"}}}'
```