fraiseql-server 2.18.0

HTTP server for FraiseQL v2 GraphQL engine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! gRPC: built and tested, mounted by no entry point yet (D-3 mounts it through `admit()`).

#[cfg(feature = "grpc")]
use super::ServeCx;
use crate::capability::Capability;

/// `[grpc]` in the compiled schema.
#[derive(Debug)]
pub struct Grpc;

#[async_trait::async_trait]
impl Capability for Grpc {
    #[cfg(feature = "grpc")]
    fn configured(&self, cx: &ServeCx<'_>) -> bool {
        cx.app.executor().schema().grpc_config.as_ref().is_some_and(|grpc| grpc.enabled)
    }
}