Struct apollo_compiler::database::hir::OperationDefinition
source · pub struct OperationDefinition { /* private fields */ }
Implementations§
source§impl OperationDefinition
impl OperationDefinition
sourcepub fn operation_ty(&self) -> OperationType
pub fn operation_ty(&self) -> OperationType
Get the kind of the operation: query
, mutation
, or subscription
sourcepub fn object_type(
&self,
db: &dyn HirDatabase
) -> Option<Arc<ObjectTypeDefinition>>
pub fn object_type( &self, db: &dyn HirDatabase ) -> Option<Arc<ObjectTypeDefinition>>
Get operation’s definition object type.
sourcepub fn variables(&self) -> &[VariableDefinition]
pub fn variables(&self) -> &[VariableDefinition]
Get a reference to the operation definition’s variables.
sourcepub fn directives(&self) -> &[Directive]
pub fn directives(&self) -> &[Directive]
Get a mutable reference to the operation definition’s directives.
sourcepub fn directive_by_name(&self, name: &str) -> Option<&Directive>
pub fn directive_by_name(&self, name: &str) -> Option<&Directive>
Returns the first directive with the given name.
For repeatable directives, see directives_by_name
(plural).
sourcepub fn directives_by_name<'def: 'name, 'name>(
&'def self,
name: &'name str
) -> impl Iterator<Item = &'def Directive> + 'name
pub fn directives_by_name<'def: 'name, 'name>( &'def self, name: &'name str ) -> impl Iterator<Item = &'def Directive> + 'name
Returns an iterator of directives with the given name.
For non-repeatable directives, directive_by_name
(singular).
sourcepub fn selection_set(&self) -> &SelectionSet
pub fn selection_set(&self) -> &SelectionSet
Get a reference to the operation definition’s selection set.
sourcepub fn fields(&self, db: &dyn HirDatabase) -> Arc<Vec<Field>>
pub fn fields(&self, db: &dyn HirDatabase) -> Arc<Vec<Field>>
Get fields in the operation definition (excluding inline fragments and fragment spreads).
sourcepub fn fields_in_inline_fragments(
&self,
db: &dyn HirDatabase
) -> Arc<Vec<Field>>
pub fn fields_in_inline_fragments( &self, db: &dyn HirDatabase ) -> Arc<Vec<Field>>
Get all fields in an inline fragment.
sourcepub fn fields_in_fragment_spread(&self, db: &dyn HirDatabase) -> Arc<Vec<Field>>
pub fn fields_in_fragment_spread(&self, db: &dyn HirDatabase) -> Arc<Vec<Field>>
Get all fields in a fragment spread
sourcepub fn fragment_references(
&self,
db: &dyn HirDatabase
) -> Arc<Vec<Arc<FragmentDefinition>>>
pub fn fragment_references( &self, db: &dyn HirDatabase ) -> Arc<Vec<Arc<FragmentDefinition>>>
Get all fragment definitions referenced by the operation.
sourcepub fn loc(&self) -> HirNodeLocation
pub fn loc(&self) -> HirNodeLocation
Get the AST location information for this HIR node.
sourcepub fn is_introspection(&self, db: &dyn HirDatabase) -> bool
pub fn is_introspection(&self, db: &dyn HirDatabase) -> bool
Returns true if this is a query operation and its SelectionSet
is an introspection.
Trait Implementations§
source§impl Clone for OperationDefinition
impl Clone for OperationDefinition
source§fn clone(&self) -> OperationDefinition
fn clone(&self) -> OperationDefinition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OperationDefinition
impl Debug for OperationDefinition
source§impl Hash for OperationDefinition
impl Hash for OperationDefinition
source§impl PartialEq<OperationDefinition> for OperationDefinition
impl PartialEq<OperationDefinition> for OperationDefinition
source§fn eq(&self, other: &OperationDefinition) -> bool
fn eq(&self, other: &OperationDefinition) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for OperationDefinition
impl StructuralEq for OperationDefinition
impl StructuralPartialEq for OperationDefinition
Auto Trait Implementations§
impl RefUnwindSafe for OperationDefinition
impl Send for OperationDefinition
impl Sync for OperationDefinition
impl Unpin for OperationDefinition
impl UnwindSafe for OperationDefinition
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.