Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 718 Bytes

File metadata and controls

38 lines (28 loc) · 718 Bytes

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
  }
}