1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::SpecificationVersion;

/// The set of capaiblities a GraphQL server supports.
#[derive(Debug, Default, PartialEq, Eq)]
pub struct CapabilitySet {
    pub(super) specification_version: SpecificationVersion,
}

impl CapabilitySet {
    /// The version of the GraphQL specification this server supports
    pub fn version_supported(&self) -> SpecificationVersion {
        self.specification_version
    }
}

impl SpecificationVersion {
    /// The capabilities of a server that implements this version of the specification
    pub fn capabilities(self) -> CapabilitySet {
        CapabilitySet {
            specification_version: self,
        }
    }
}