Struct apollo_compiler::executable::Field
source · pub struct Field {
pub definition: Node<FieldDefinition>,
pub alias: Option<Name>,
pub name: Name,
pub arguments: Vec<Node<Argument>>,
pub directives: Directives,
pub selection_set: SelectionSet,
}
Fields§
§definition: Node<FieldDefinition>
The definition of this field in an object type or interface type definition in the schema
alias: Option<Name>
§name: Name
§arguments: Vec<Node<Argument>>
§directives: Directives
§selection_set: SelectionSet
Implementations§
source§impl Field
impl Field
sourcepub fn new(name: impl Into<Name>, definition: Node<FieldDefinition>) -> Self
pub fn new(name: impl Into<Name>, definition: Node<FieldDefinition>) -> Self
Create a new field with the given name and type.
See SelectionSet::new_field
too look up the type in a schema instead.
pub fn with_alias(self, alias: impl Into<Name>) -> Self
pub fn with_opt_alias(self, alias: Option<impl Into<Name>>) -> Self
pub fn with_directive(self, directive: impl Into<Node<Directive>>) -> Self
pub fn with_directives( self, directives: impl IntoIterator<Item = Node<Directive>> ) -> Self
pub fn with_argument( self, name: impl Into<Name>, value: impl Into<Node<Value>> ) -> Self
pub fn with_arguments( self, arguments: impl IntoIterator<Item = Node<Argument>> ) -> Self
pub fn with_selection(self, selection: impl Into<Selection>) -> Self
pub fn with_selections( self, selections: impl IntoIterator<Item = impl Into<Selection>> ) -> Self
sourcepub fn response_key(&self) -> &Name
pub fn response_key(&self) -> &Name
Returns the response key for this field: the alias if there is one, or the name
sourcepub fn inner_type_def<'a>(&self, schema: &'a Schema) -> Option<&'a ExtendedType>
pub fn inner_type_def<'a>(&self, schema: &'a Schema) -> Option<&'a ExtendedType>
Look up in schema
the definition of the inner type of this field.
The inner type is ty()
after unwrapping non-null and list markers.
Trait Implementations§
source§impl PartialEq for Field
impl PartialEq for Field
impl Eq for Field
impl StructuralEq for Field
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.