pub struct ArgumentsDefinition { /* private fields */ }
Expand description

The ArgumentsDefinition type represents an arguments definition

ArgumentsDefinition: ( InputValueDefinition* )

Detailed documentation can be found in GraphQL spec.

Example

use apollo_encoder::{ArgumentsDefinition, InputValueDefinition, Type_};
use indoc::indoc;

let input_value_defs = vec![
    InputValueDefinition::new(
        String::from("first"),
        Type_::NamedType {
            name: String::from("Int"),
        },
    ),
    InputValueDefinition::new(
        String::from("second"),
        Type_::List {
            ty: Box::new(Type_::NamedType {
                name: String::from("Int"),
            }),
        },
    ),
];
let arguments_def = ArgumentsDefinition::new(input_value_defs);

assert_eq!(arguments_def.to_string(), r#"(first: Int, second: [Int])"#);

Implementations

Create a new instance of Argument definition.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.