server: refer to async_graphql extensions through extensions module

This commit is contained in:
Bill Thiede 2024-12-19 18:35:03 -08:00
parent 51154044cc
commit 760f90762d

View File

@ -5,7 +5,7 @@
extern crate rocket; extern crate rocket;
use std::{error::Error, io::Cursor, str::FromStr}; use std::{error::Error, io::Cursor, str::FromStr};
use async_graphql::{http::GraphiQLSource, EmptySubscription, Schema}; use async_graphql::{extensions, http::GraphiQLSource, EmptySubscription, Schema};
use async_graphql_rocket::{GraphQLQuery, GraphQLRequest, GraphQLResponse}; use async_graphql_rocket::{GraphQLQuery, GraphQLRequest, GraphQLResponse};
use notmuch::{Notmuch, NotmuchError, ThreadSet}; use notmuch::{Notmuch, NotmuchError, ThreadSet};
use rocket::{ use rocket::{
@ -228,7 +228,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
#[cfg(feature = "tantivy")] #[cfg(feature = "tantivy")]
let schema = schema.data(tantivy_conn); let schema = schema.data(tantivy_conn);
let schema = schema.extension(async_graphql::extensions::Logger).finish(); let schema = schema.extension(extensions::Logger).finish();
let rkt = rkt.manage(schema).manage(pool).manage(Notmuch::default()); let rkt = rkt.manage(schema).manage(pool).manage(Notmuch::default());
//.manage(Notmuch::with_config("../notmuch/testdata/notmuch.config")) //.manage(Notmuch::with_config("../notmuch/testdata/notmuch.config"))