A fun little experiment to help me brush up on my Rust.
This is a simple little GraphQL ToDo Api built with:
- Rust (obviously)
- Async Graphql
- AWS Lambda (via SAM and cargo-lambda)
- DynamoDB
- serde_dynamo 🙂
type CompleteResult {
username: String!
task: String!
}
type Mutation {
addTodo(username: String!, task: String!): Todo!
markTodoComplete(username: String!, task: String!): CompleteResult!
}
type Query {
user(username: String!): User!
users: [User!]!
}
type Todo {
task: String!
completed: Boolean!
}
type User {
username: String!
todos: [Todo!]!
}
schema {
query: Query
mutation: Mutation
}
- Make sure you have an aws profile configured via:
aws configure
(You will need access creds configured on your profile). - In the root of this repo:
sam build
sam deploy
(Follow the prompts)- Query Away
- Refactor the graphql error handling to not be a hack... 🙈
- Learn the best way to unit test this kind of code 🧪
- Learn about better dependency injection practices with Rust 🏗️