Struct fuel_indexer_lib::graphql::parser::ParsedGraphQLSchema
source · pub struct ParsedGraphQLSchema { /* private fields */ }Expand description
A wrapper object used to encapsulate a lot of the boilerplate logic related to parsing schema, creating mappings of types, fields, objects, etc.
Implementations§
source§impl ParsedGraphQLSchema
impl ParsedGraphQLSchema
sourcepub fn new(
namespace: &str,
identifier: &str,
exec_source: ExecutionSource,
schema: Option<&GraphQLSchema>
) -> ParsedResult<Self>
pub fn new( namespace: &str, identifier: &str, exec_source: ExecutionSource, schema: Option<&GraphQLSchema> ) -> ParsedResult<Self>
Create a new ParsedGraphQLSchema.
sourcepub fn identifier(&self) -> &str
pub fn identifier(&self) -> &str
Identifier of the indexer.
sourcepub fn exec_source(&self) -> &ExecutionSource
pub fn exec_source(&self) -> &ExecutionSource
Indexer method of execution.
sourcepub fn objects(&self) -> &HashMap<String, ObjectType>
pub fn objects(&self) -> &HashMap<String, ObjectType>
Mapping of object names to objects.
sourcepub fn field_type_mappings(&self) -> &HashMap<String, String>
pub fn field_type_mappings(&self) -> &HashMap<String, String>
Mapping of fully qualified field names to their field types.
sourcepub fn field_type_optionality(&self) -> &HashMap<String, bool>
pub fn field_type_optionality(&self) -> &HashMap<String, bool>
A mapping of fully qualified field names to their respective optionalities.
sourcepub fn ast(&self) -> &ServiceDocument
pub fn ast(&self) -> &ServiceDocument
The parsed schema AST.
sourcepub fn schema(&self) -> &GraphQLSchema
pub fn schema(&self) -> &GraphQLSchema
Raw GraphQL schema content.
sourcepub fn type_defs(&self) -> &HashMap<String, TypeDefinition>
pub fn type_defs(&self) -> &HashMap<String, TypeDefinition>
All type definitions in the schema.
sourcepub fn field_defs(&self) -> &HashMap<String, (FieldDefinition, String)>
pub fn field_defs(&self) -> &HashMap<String, (FieldDefinition, String)>
Mapping of fully qualified field names to their FieldDefinition and TypeDefinition name.
sourcepub fn foreign_key_mappings(
&self
) -> &HashMap<String, HashMap<String, (String, String)>>
pub fn foreign_key_mappings( &self ) -> &HashMap<String, HashMap<String, (String, String)>>
All unique names of foreign key types in the schema.
sourcepub fn object_field_mappings(
&self
) -> &HashMap<String, BTreeMap<String, String>>
pub fn object_field_mappings( &self ) -> &HashMap<String, BTreeMap<String, String>>
All objects and their field names and types, indexed by object name.
sourcepub fn join_table_meta(&self) -> &HashMap<String, JoinTableMeta>
pub fn join_table_meta(&self) -> &HashMap<String, JoinTableMeta>
Metadata related to many-to-many relationships in the GraphQL schema.
sourcepub fn scalar_type_for(&self, f: &FieldDefinition) -> String
pub fn scalar_type_for(&self, f: &FieldDefinition) -> String
Return the base scalar type for a given FieldDefinition.
sourcepub fn get_union(&self, name: &str) -> Option<&TypeDefinition>
pub fn get_union(&self, name: &str) -> Option<&TypeDefinition>
Return the TypeDefinition associated with a given union name.
sourcepub fn non_enum_typdefs(&self) -> Vec<(&String, &TypeDefinition)>
pub fn non_enum_typdefs(&self) -> Vec<(&String, &TypeDefinition)>
Return a list of all non-enum type definitions.
sourcepub fn is_possible_foreign_key(&self, name: &str) -> bool
pub fn is_possible_foreign_key(&self, name: &str) -> bool
Whether the given field type name is a possible foreign key.
sourcepub fn is_virtual_typedef(&self, name: &str) -> bool
pub fn is_virtual_typedef(&self, name: &str) -> bool
Whether the given field type name is a type from which tables are not created.
sourcepub fn is_enum_typedef(&self, name: &str) -> bool
pub fn is_enum_typedef(&self, name: &str) -> bool
Whether the given field type name is an enum type.
sourcepub fn is_list_field_type(&self, name: &str) -> bool
pub fn is_list_field_type(&self, name: &str) -> bool
Whether the given field type name is a list type.
sourcepub fn is_list_typedef(&self, name: &str) -> bool
pub fn is_list_typedef(&self, name: &str) -> bool
Whether a given TypeDefinition contains a field that is a list type.
sourcepub fn is_union_typedef(&self, name: &str) -> bool
pub fn is_union_typedef(&self, name: &str) -> bool
Whether the given field type name is a union type.
sourcepub fn graphql_type(&self, cond: Option<&String>, name: &str) -> Option<&String>
pub fn graphql_type(&self, cond: Option<&String>, name: &str) -> Option<&String>
Return the GraphQL type for a given FieldDefinition or TypeDefinition name.
sourcepub fn has_type(&self, name: &str) -> bool
pub fn has_type(&self, name: &str) -> bool
Ensure the given type is included in this Schema’s types
sourcepub fn fully_qualified_namespace(&self) -> String
pub fn fully_qualified_namespace(&self) -> String
Fully qualified GraphQL namespace for indexer.
Trait Implementations§
source§impl Clone for ParsedGraphQLSchema
impl Clone for ParsedGraphQLSchema
source§fn clone(&self) -> ParsedGraphQLSchema
fn clone(&self) -> ParsedGraphQLSchema
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more