/rust-todos

Rust with Diesel (PostgreSQL) and GraphQL todo bck-end

Primary LanguageRust

A simple API the creates and see todos.

Written in Rust, using Actix, Diesel and GraphQL

How to run

First of all, copy the .env.example to .env file, and update DATABASE_URL var, using your database credentials.

Then, run the project with:

cargo run

And access http://localhost:8000/graphiql in your browser.

Get all todos from database:

query GetTodos {
    todos {
        id
        title
        completed
    }
}

Create a new todo:

mutation CreateTodo {
  createTodo(newTodo: {
    title: "Update README",
    completed: true,
  }) {
    id,
    title,
    completed
  }
}

Mady with 💜 by Felipe