Struct apollo_compiler::database::hir::SchemaDefinition
source · pub struct SchemaDefinition { /* private fields */ }
Implementations§
source§impl SchemaDefinition
impl SchemaDefinition
pub fn description(&self) -> Option<&str>
sourcepub fn self_directives(&self) -> &[Directive]
pub fn self_directives(&self) -> &[Directive]
Get a reference to the schema definition’s directives (excluding those on extensions).
sourcepub fn directives(&self) -> impl Iterator<Item = &Directive> + '_
pub fn directives(&self) -> impl Iterator<Item = &Directive> + '_
Returns an iterator of directives on either the schema
definition or its extensions
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).
Includes directives on either the schema
definition or its extensions,
like directives
.
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).
Includes directives on either the schema
definition or its extensions,
like directives
.
sourcepub fn self_root_operations(&self) -> &[RootOperationTypeDefinition]
pub fn self_root_operations(&self) -> &[RootOperationTypeDefinition]
Returns the root operations from this schema definition, excluding those from schema extensions.
sourcepub fn root_operations(
&self
) -> impl Iterator<Item = &RootOperationTypeDefinition>
pub fn root_operations( &self ) -> impl Iterator<Item = &RootOperationTypeDefinition>
Returns an iterator of root operations, from either on this schema defintion or its extensions.
sourcepub fn loc(&self) -> Option<HirNodeLocation>
pub fn loc(&self) -> Option<HirNodeLocation>
Get the AST location information for this HIR node.
sourcepub fn extensions(&self) -> &[Arc<SchemaExtension>]
pub fn extensions(&self) -> &[Arc<SchemaExtension>]
Extensions that apply to this definition
sourcepub fn root_operation_name(&self, ty: OperationType) -> Option<&str>
pub fn root_operation_name(&self, ty: OperationType) -> Option<&str>
Returns the name of the object type for the root operation of the given kind, defined either on this schema defintion or its extensions.
The corresponding object type definition can be found
at compiler.db.object_types().get(name)
.
sourcepub fn query(&self) -> Option<&str>
pub fn query(&self) -> Option<&str>
Returns the name of the object type for the query
root operation,
defined either on this schema defintion or its extensions.
The corresponding object type definition can be found
at compiler.db.object_types().get(name)
.
sourcepub fn mutation(&self) -> Option<&str>
pub fn mutation(&self) -> Option<&str>
Returns the name of the object type for the mutation
root operation,
defined either on this schema defintion or its extensions.
The corresponding object type definition can be found
at compiler.db.object_types().get(name)
.
sourcepub fn subscription(&self) -> Option<&str>
pub fn subscription(&self) -> Option<&str>
Returns the name of the object type for the subscription
root operation,
defined either on this schema defintion or its extensions.
The corresponding object type definition can be found
at compiler.db.object_types().get(name)
.
Trait Implementations§
source§impl Clone for SchemaDefinition
impl Clone for SchemaDefinition
source§fn clone(&self) -> SchemaDefinition
fn clone(&self) -> SchemaDefinition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SchemaDefinition
impl Debug for SchemaDefinition
source§impl Default for SchemaDefinition
impl Default for SchemaDefinition
source§fn default() -> SchemaDefinition
fn default() -> SchemaDefinition
source§impl Hash for SchemaDefinition
impl Hash for SchemaDefinition
source§impl PartialEq<SchemaDefinition> for SchemaDefinition
impl PartialEq<SchemaDefinition> for SchemaDefinition
source§fn eq(&self, other: &SchemaDefinition) -> bool
fn eq(&self, other: &SchemaDefinition) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for SchemaDefinition
impl StructuralEq for SchemaDefinition
impl StructuralPartialEq for SchemaDefinition
Auto Trait Implementations§
impl RefUnwindSafe for SchemaDefinition
impl Send for SchemaDefinition
impl Sync for SchemaDefinition
impl Unpin for SchemaDefinition
impl UnwindSafe for SchemaDefinition
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
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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.