hive-router 0.2.0

GraphQL router for Federation, part of the Hive platform
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

/// Defines the value for disabling introspection queries.
///
/// It can be a simple boolean,
/// or an object containing the expression that evaluates to a boolean.
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema)]
#[serde(untagged)]
pub enum IntrospectionPermissionConfig {
    /// A static boolean value to enable or disable the introspection.
    Boolean(bool),
    /// A dynamic value computed by an expression.
    Expression {
        /// An expression that must evaluate to a boolean. If true, the introspection queries are allowed.
        expression: String,
    },
}