This a simple Web Api using GraphQL.
- Pyhon3 Python is a programminglanguage that lets you work quickllu and integrate more effectively
- Flask Flask is a microframework written in Python
- Flask SQLAlchemy Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application
- Ariadne taps into the leading approach in the GraphQL community and opens up hundreds of developer tools, examples, and learning resources.
- Postgres is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
Build the image:
docker build -t graphql-python-api:latest -f graphql-python-api/Dockerfile graphql-python-api
Run the container with the following command:
docker run -p 5000:5000 graphql-python-api:latest
query GetPost {
getPost(id: "3"){
post {
id
title
description
}
success
errors
}
}
mutation newPost {
createPost(
title: "Welcome to my Blog",
description:"This is a description") {
post {
id
title
description
}
success
errors
}
}
mutation DeletePost {
deletePost(id: 1){
success
errors
}
}
mutation UpdatePost {
updatePost(id: 2,title:"This is another new night", description:"another detail of a new night"){
success
errors
}
}