pub trait HirDatabase: Database + HasQueryGroup<HirStorage> + InputDatabase + AstDatabase {
Show 36 methods fn type_system_definitions(&self) -> Arc<TypeSystemDefinitions>; fn type_system(&self) -> Arc<TypeSystem>; fn operations(&self, key0: FileId) -> Arc<Vec<Arc<OperationDefinition>>>; fn fragments(&self, key0: FileId) -> ByName<FragmentDefinition>; fn all_operations(&self) -> Arc<Vec<Arc<OperationDefinition>>>; fn all_fragments(&self) -> ByName<FragmentDefinition>; fn schema(&self) -> Arc<SchemaDefinition>; fn object_types(&self) -> ByName<ObjectTypeDefinition>; fn scalars(&self) -> ByName<ScalarTypeDefinition>; fn enums(&self) -> ByName<EnumTypeDefinition>; fn unions(&self) -> ByName<UnionTypeDefinition>; fn interfaces(&self) -> ByName<InterfaceTypeDefinition>; fn directive_definitions(&self) -> ByName<DirectiveDefinition>; fn input_objects(&self) -> ByName<InputObjectTypeDefinition>; fn find_operation_by_name(
        &self,
        key0: FileId,
        key1: String
    ) -> Option<Arc<OperationDefinition>>; fn find_anonymous_operation(
        &self,
        key0: FileId
    ) -> Option<Arc<OperationDefinition>>; fn find_fragment_by_name(
        &self,
        key0: FileId,
        key1: String
    ) -> Option<Arc<FragmentDefinition>>; fn find_object_type_by_name(
        &self,
        key0: String
    ) -> Option<Arc<ObjectTypeDefinition>>; fn find_union_by_name(
        &self,
        key0: String
    ) -> Option<Arc<UnionTypeDefinition>>; fn find_enum_by_name(&self, key0: String) -> Option<Arc<EnumTypeDefinition>>; fn find_interface_by_name(
        &self,
        key0: String
    ) -> Option<Arc<InterfaceTypeDefinition>>; fn find_directive_definition_by_name(
        &self,
        key0: String
    ) -> Option<Arc<DirectiveDefinition>>; fn find_types_with_directive(&self, key0: String) -> Arc<Vec<TypeDefinition>>; fn find_input_object_by_name(
        &self,
        key0: String
    ) -> Option<Arc<InputObjectTypeDefinition>>; fn types_definitions_by_name(&self) -> Arc<IndexMap<String, TypeDefinition>>; fn find_type_definition_by_name(
        &self,
        key0: String
    ) -> Option<TypeDefinition>; fn query_operations(
        &self,
        key0: FileId
    ) -> Arc<Vec<Arc<OperationDefinition>>>; fn mutation_operations(
        &self,
        key0: FileId
    ) -> Arc<Vec<Arc<OperationDefinition>>>; fn subscription_operations(
        &self,
        key0: FileId
    ) -> Arc<Vec<Arc<OperationDefinition>>>; fn operation_fields(&self, key0: SelectionSet) -> Arc<Vec<Field>>; fn operation_inline_fragment_fields(
        &self,
        key0: SelectionSet
    ) -> Arc<Vec<Field>>; fn operation_fragment_spread_fields(
        &self,
        key0: SelectionSet
    ) -> Arc<Vec<Field>>; fn selection_variables(&self, key0: SelectionSet) -> Arc<HashSet<Variable>>; fn operation_definition_variables(
        &self,
        key0: Arc<Vec<VariableDefinition>>
    ) -> Arc<HashSet<Variable>>; fn subtype_map(&self) -> Arc<HashMap<String, HashSet<String>>>; fn is_subtype(&self, key0: String, key1: String) -> bool;
}

Required Methods§

Return all type system definitions defined in the compiler.

Return a TypeSystem containing definitions and more.

This can be used with set_type_system_hir on another compiler.

Return all the operations defined in a file.

Return all the fragments defined in a file.

Return all the operations defined in any file.

Return all the fragments defined in any file.

Return schema definition defined in the compiler.

Return all object type definitions defined in the compiler.

Return all scalar type definitions defined in the compiler.

Return all enum type definitions defined in the compiler.

Return all union type definitions defined in the compiler.

Return all interface type definitions defined in the compiler.

Return all directive definitions defined in the compiler.

Return all input object type definitions defined in the compiler.

Return an operation definition corresponding to the name and file id.

Return an operation definition without a name, corresponding to the file id.

Return an fragment definition corresponding to the name and file id. Result of this query is not cached internally.

Return an object type definition corresponding to the name. Result of this query is not cached internally.

Return an union type definition corresponding to the name. Result of this query is not cached internally.

Return an enum type definition corresponding to the name. Result of this query is not cached internally.

Return an interface type definition corresponding to the name. Result of this query is not cached internally.

Return an directive definition corresponding to the name. Result of this query is not cached internally.

Return any type definitions that contain the corresponding directive

Return an input object type definition corresponding to the name. Result of this query is not cached internally.

Return a type definition corresponding to the name. Result of this query is not cached internally.

Return all query operations in a corresponding file.

Return all mutation operations in a corresponding file.

Return all subscription operations in a corresponding file.

Return all operation fields in a corresponding selection set.

Return all operation inline fragment fields in a corresponding selection set.

Return all operation fragment spread fields in a corresponding selection set.

Return all variables in a corresponding selection set.

Return all variables in corresponding variable definitions.

Return a subtype map of the current compiler’s type system.

Given the following schema,

type Query {
  me: String
}
type Foo {
  me: String
}
type Bar {
  me: String
}
union UnionType = Foo | Bar

interface Baz {
  me: String,
}
type ObjectType implements Baz { me: String }
interface InterfaceType implements Baz { me: String }

we can say that:

  • Foo and Bar are a subtypes of UnionType.
  • ObjectType and InterfaceType are subtypes of Baz.

Return true if the provided maybe_subtype is a subtype of the corresponding abstract_type.

Given the following schema,

type Query {
  me: String
}
type Foo {
  me: String
}
type Bar {
  me: String
}
union UnionType = Foo | Bar

interface Baz {
  me: String,
}
type ObjectType implements Baz { me: String }
interface InterfaceType implements Baz { me: String }

we can say that:

  • db.is_subtype("UnionType".into(), "Foo".into()) // true
  • db.is_subtype("UnionType".into(), "Bar".into()) // true
  • db.is_subtype("Baz".into(), "ObjectType".into()) // true
  • db.is_subtype("Baz".into(), "InterfaceType".into()) // true

Trait Implementations§

Implementors§