INNER CODE UNIT · Rust

max_directive_definitions

apollographql/apollo-rs · crates/apollo-smith/src/lib.rs:218

    pub fn max_directive_definitions(mut self, max: usize) -> Self {
        self.max_directive_definitions = max;
        self
    }

    /// Set the maximum number of operation definitions (default 50).
    pub fn max_operation_definitions(mut self, max: usize) -> Self {
        self.max_operation_definitions = max;
        self
    }

    /// Generate random definitions according to the configured maximums
    /// and return the resulting [`Document`].
    pub fn build(mut self) -> Result<Document> {
        for _ in 0..self.u.int_in_range(1..=self.max_scalar_types)? {
            let scalar_type_def = self.scalar_type_definition()?;
            self.scalar_type_defs.push(scalar_type_def);
        }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…