server: add mutation to mark messages as read

This commit is contained in:
2024-02-11 19:43:34 -08:00
parent 81ed3a8ca2
commit 5451dd2056
3 changed files with 35 additions and 18 deletions

View File

@@ -2,7 +2,7 @@
extern crate rocket;
use std::{error::Error, io::Cursor, str::FromStr};
use async_graphql::{http::GraphiQLSource, EmptyMutation, EmptySubscription, Schema};
use async_graphql::{http::GraphiQLSource, EmptySubscription, Schema};
use async_graphql_rocket::{GraphQLQuery, GraphQLRequest, GraphQLResponse};
use glog::Flags;
use notmuch::{Notmuch, NotmuchError, ThreadSet};
@@ -16,7 +16,7 @@ use rocket::{
use rocket_cors::{AllowedHeaders, AllowedOrigins};
use server::{
error::ServerError,
graphql::{GraphqlSchema, QueryRoot},
graphql::{GraphqlSchema, Mutation, QueryRoot},
};
#[get("/refresh")]
@@ -182,7 +182,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
}
.to_cors()?;
let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription)
let schema = Schema::build(QueryRoot, Mutation, EmptySubscription)
.data(Notmuch::default())
.extension(async_graphql::extensions::Logger)
.finish();