juniper/tests/codegen/fail/subscription/field_not_async.rs

18 lines
337 B
Rust
Raw Normal View History

use std::{future, pin::Pin};
use futures::{stream, Stream};
use juniper::graphql_subscription;
type BoxStream<'a, I> = Pin<Box<dyn Stream<Item = I> + Send + 'a>>;
struct ObjA;
#[graphql_subscription]
impl ObjA {
fn id(&self) -> BoxStream<'static, bool> {
Box::pin(stream::once(future::ready(true)))
}
}
fn main() {}