Cristiano-Rocha / graphql-python-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

graphql-python-api

This a simple Web Api using GraphQL.

Tecnologies used

  • 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.

🌱 How to start this project

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

Queries

GET

query GetPost {
  getPost(id: "3"){
    post {
      id
      title
      description
    }
    success
    errors
  }
}

POST

mutation newPost {
  createPost(
    title: "Welcome to my Blog",
    description:"This is a description") {
    post {
      id
      title
      description
    }
    success
    errors
  }
}

DELETE

mutation DeletePost {
  deletePost(id: 1){
    success
    errors
  }
}

PUT

mutation UpdatePost {
  updatePost(id: 2,title:"This is another new night", description:"another detail of a new night"){
    success
    errors
  }
}

About


Languages

Language:Python 87.5%Language:Dockerfile 12.5%