hive-router 0.2.7

GraphQL router for Federation, part of the Hive platform
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)]
#[non_exhaustive]
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,
    },
}