summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-08-21 13:25:55 +0200
committerSanto Cariotti <santo@dcariotti.me>2024-08-21 13:25:55 +0200
commita92fb07d23fb2268a6f4e650c5cbd00ad993e760 (patch)
tree149f2d084b8fec0b5a2bc5364f5d9e3487c94971 /src/main.rs
parent24388ba81515c57e812994fdb9147e6de7f3a5b6 (diff)
Add login
Fields sent are ``` { "query": "mutation Login($input: LoginCredentials!) { login(input: $input) { accessToken tokenType } }", "variables": { "input": { "email": "....", "password": "..." } } } ```
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index e87a7c4..04e2564 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,7 +8,7 @@ mod state;
use std::{net::SocketAddr, sync::Arc, time::Duration};
use crate::config::CONFIG;
-use async_graphql::{EmptyMutation, EmptySubscription, Schema};
+use async_graphql::{EmptySubscription, Schema};
use axum::{
http::{header, Request},
routing::post,
@@ -30,9 +30,13 @@ async fn create_app() -> Router {
client: Arc::new(dbclient),
};
- let schema = Schema::build(graphql::query::Query, EmptyMutation, EmptySubscription)
- .data(state.clone())
- .finish();
+ let schema = Schema::build(
+ graphql::query::Query,
+ graphql::mutation::Mutation,
+ EmptySubscription,
+ )
+ .data(state.clone())
+ .finish();
Router::new()
.route(
"/graphql",