mrkiura / todo-grapqhl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

todo-grapqhl

Simple GraphQL server that allows managing todos:

  • Add new todos
  • List all todos

Installation

Clone and nathe repo

git clone https://github.com/alexkiura/todo-grapqhl

Navigate to the root folder

cd todo-graphql

Create a virtualenv

python3 -m venv todo_env

Install required packages

pip install -r requirements.txt

Running the app

Start the server

python main.py

Open the GraphQL PlayGround by visiting http://127.0.0.1:5000/graphql

Paste the query below in the editor and press the play button to get a list of available todos:

query myQuery{
  todos {
    id
    description
    completed
  }
}

To add a new todo, type a mutation in the editor, similar to the one below:

mutation newTodo {
  createTodo(input:{description:"Go to the gym", dueDate:1601845200.0}) {
    description
    dueDate
    completed
  }
}

About


Languages

Language:Python 100.0%