Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jottenlips/jazz-charts-api
🎼 Simple API demonstrating Ariadne GraphQL, Pytest, Serverless, Moto, and DynamoDB
https://github.com/jottenlips/jazz-charts-api
ariadne boto3 dynamodb example flask graphql graphql-server jazz moto pytest python schema-first sdl serverless testing
Last synced: about 1 month ago
JSON representation
🎼 Simple API demonstrating Ariadne GraphQL, Pytest, Serverless, Moto, and DynamoDB
- Host: GitHub
- URL: https://github.com/jottenlips/jazz-charts-api
- Owner: jottenlips
- License: mit
- Created: 2019-11-24T02:34:26.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T22:34:46.000Z (about 2 years ago)
- Last Synced: 2024-10-31T09:42:17.697Z (3 months ago)
- Topics: ariadne, boto3, dynamodb, example, flask, graphql, graphql-server, jazz, moto, pytest, python, schema-first, sdl, serverless, testing
- Language: Python
- Homepage: https://kyv1ir2pra.execute-api.us-east-1.amazonaws.com/dev/graphql
- Size: 27.1 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deploy
Setup .aws credentials.
```console
npm install -g serverless
sls deploy
```# Offline Dev
Set up your .aws credentials, make a DynamoDB table named jazz-charts-dev
Install node (to run serverless-offline). I use nvm to manage my node versions.
Go to your jazz-charts-api folder:
`npm install`
`virtualenv -p python3 venv`
`source venv/bin/activate`
`pip install -r requirements.txt`
`sls wsgi serve -p 8000`
Run queries in Graphi at http://localhost:8000/graphql
## Run Tests
`TABLE_NAME=jazz-charts-test python -m pytest`
*Composer*
* getComposer
* getComposers
* createComposer
* updateComposer
*Song*
* getSong
* getSongs
* createSong
* updateSong
Example Query:
```
{
getComposer(id: "c1") {
id
fullName
songs {
id
title
chordChart
}
}
}
```Example Response:
```
{
"data": {
"getComposer": {
"id": "c1",
"fullName": "Jerome Kern",
"songs": [
{
"id": "1",
"title": "All the Things You Are"
"chordChart": "Db7#9 | % | C7#9 | % | F-7 | Bb-7 | Eb7 | AbMaj7 | DbMaj7 | G7 | CMaj7 | % | C-7 | F-7 | Bb7 | Ab-6 | EbMaj7 | F-7b5 | Bb7b5 | Ab-6 | EbMaj7 | G-7 | C7 | AbMaj7 | A-7b5 D7b9 | G-7 |C7 | F-7 C7 | F-7 Bb7 | Eb6 | F-7"
}
]
}
}
}
```