Try using axum instead of rocket. WS doesn't seem to work through trunk
This commit is contained in:
@@ -3,7 +3,8 @@ use std::{fmt, str::FromStr};
|
||||
use async_graphql::{
|
||||
connection::{self, Connection, Edge, OpaqueCursor},
|
||||
futures_util::{Stream, StreamExt},
|
||||
Context, Enum, Error, FieldResult, InputObject, Object, Schema, SimpleObject, Union,
|
||||
Context, Enum, Error, FieldResult, InputObject, Object, Schema, SimpleObject, Subscription,
|
||||
Union,
|
||||
};
|
||||
use cacher::FilesystemCacher;
|
||||
use futures::stream;
|
||||
@@ -594,9 +595,9 @@ async fn tantivy_search(
|
||||
.collect())
|
||||
}
|
||||
|
||||
pub struct Mutation;
|
||||
pub struct MutationRoot;
|
||||
#[Object]
|
||||
impl Mutation {
|
||||
impl MutationRoot {
|
||||
#[instrument(skip_all, fields(query=query, unread=unread, rid=request_id()))]
|
||||
async fn set_read_status<'ctx>(
|
||||
&self,
|
||||
@@ -648,6 +649,7 @@ impl Mutation {
|
||||
|
||||
tantivy.drop_and_load_index()?;
|
||||
tantivy.reindex_all(pool).await?;
|
||||
println("hit");
|
||||
|
||||
Ok(true)
|
||||
}
|
||||
@@ -668,12 +670,12 @@ impl Mutation {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Subscription;
|
||||
#[async_graphql::Subscription]
|
||||
impl Subscription {
|
||||
pub struct SubscriptionRoot;
|
||||
#[Subscription]
|
||||
impl SubscriptionRoot {
|
||||
async fn values(&self, ctx: &Context<'_>) -> Result<impl Stream<Item = usize>, Error> {
|
||||
Ok(stream::iter(0..10))
|
||||
}
|
||||
}
|
||||
|
||||
pub type GraphqlSchema = Schema<QueryRoot, Mutation, Subscription>;
|
||||
pub type GraphqlSchema = Schema<QueryRoot, MutationRoot, SubscriptionRoot>;
|
||||
|
||||
Reference in New Issue
Block a user