graphql_federated_graph/federated_graph/
extensions.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;

#[derive(Clone, Debug)]
pub struct Extension {
    /// Name of the extension within the federated graph. It does NOT necessarily matches the extension's name
    /// in its manifest, see the `id` field for this.
    pub enum_value_id: EnumValueId,
    pub url: StringId,
    pub schema_directives: Vec<ExtensionLinkSchemaDirective>,
}

impl FederatedGraph {
    pub fn push_extension(&mut self, extension: Extension) -> ExtensionId {
        let id = self.extensions.len().into();
        self.extensions.push(extension);
        id
    }
}