Struct apollo_encoder::Field [−][src]
pub struct Field { /* fields omitted */ }Expand description
The __Field type represents each field in an Object or Interface type.
FieldDefinition: Description? Name ArgumentsDefinition? : TypeDirectives?
Detailed documentation can be found in GraphQL spec.
Example
use apollo_encoder::{Type_, Field, InputValue};
let ty_1 = Type_::NamedType {
name: "CatBreed".to_string(),
};
let mut field = Field::new("cat".to_string(), ty_1);
let value_1 = Type_::NamedType {
name: "CatBreed".to_string(),
};
let arg = InputValue::new("breed".to_string(), value_1);
field.arg(arg);
assert_eq!(
field.to_string(),
r#" cat(breed: CatBreed): CatBreed"#
);Implementations
Set the Field’s description.
Set the Field’s deprecation properties.
Set the Field’s arguments.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Field
impl UnwindSafe for Field
Blanket Implementations
Mutably borrows from an owned value. Read more