async-graphql-sqlx-example icon indicating copy to clipboard operation
async-graphql-sqlx-example copied to clipboard

Minimal example using async_graphql, sqlx, warp, and sqlite

Rust GraphQL API Example

Minimal example using async graphql, sqlx, warp, and sqlite.

The GraphQL api has CRUD actions on todos as well as subscriptions to changes.

Running

Clone the repo and run

cargo run

Open up http://localhost:8080 to see the GraphQL playground

Create a subscription in one window:

subscription {
  todos {
    id
    mutationType
    item
  }
}

Next, create a new todo in another window:

mutation {
  createTodo(body: "New todo!", complete: false) {
    id
    body
  }
}