diff options
author | Santo Cariotti <santo@dcariotti.me> | 2024-08-21 13:25:55 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2024-08-21 13:25:55 +0200 |
commit | a92fb07d23fb2268a6f4e650c5cbd00ad993e760 (patch) | |
tree | 149f2d084b8fec0b5a2bc5364f5d9e3487c94971 /src/graphql/routes.rs | |
parent | 24388ba81515c57e812994fdb9147e6de7f3a5b6 (diff) |
Add login
Fields sent are
```
{
"query": "mutation Login($input: LoginCredentials!) { login(input: $input) { accessToken tokenType } }",
"variables": {
"input": {
"email": "....",
"password": "..."
}
}
}
```
Diffstat (limited to 'src/graphql/routes.rs')
-rw-r--r-- | src/graphql/routes.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/graphql/routes.rs b/src/graphql/routes.rs index 2380760..e15267e 100644 --- a/src/graphql/routes.rs +++ b/src/graphql/routes.rs @@ -1,10 +1,11 @@ -use crate::graphql::query::*; -use async_graphql::{EmptyMutation, EmptySubscription, Schema}; +use crate::graphql::mutation::Mutation; +use crate::graphql::query::Query; +use async_graphql::{EmptySubscription, Schema}; use async_graphql_axum::{GraphQLRequest, GraphQLResponse}; use std::sync::Arc; pub async fn graphql_handler( - schema: Arc<Schema<Query, EmptyMutation, EmptySubscription>>, + schema: Arc<Schema<Query, Mutation, EmptySubscription>>, req: GraphQLRequest, ) -> GraphQLResponse { schema.execute(req.into_inner()).await.into() |