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