pub trait ValidationDatabase: Database + HasQueryGroup<ValidationStorage> + Upcast<dyn HirDatabase> + InputDatabase + AstDatabase + HirDatabase {
Show 50 methods
// Required methods
fn validate(&self) -> Vec<ApolloDiagnostic>;
fn validate_type_system(&self) -> Vec<ApolloDiagnostic>;
fn validate_executable(&self, key0: FileId) -> Vec<ApolloDiagnostic>;
fn validate_name_uniqueness(&self) -> Vec<ApolloDiagnostic>;
fn validate_schema_definition(
&self,
key0: Arc<SchemaDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_root_operation_definitions(
&self,
key0: Vec<RootOperationTypeDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_scalar_definitions(&self) -> Vec<ApolloDiagnostic>;
fn validate_scalar_definition(
&self,
key0: Arc<ScalarTypeDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_enum_definitions(&self) -> Vec<ApolloDiagnostic>;
fn validate_enum_definition(
&self,
key0: Arc<EnumTypeDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_enum_value(
&self,
key0: EnumValueDefinition
) -> Vec<ApolloDiagnostic>;
fn validate_union_definitions(&self) -> Vec<ApolloDiagnostic>;
fn validate_union_definition(
&self,
key0: Arc<UnionTypeDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_interface_definitions(&self) -> Vec<ApolloDiagnostic>;
fn validate_interface_definition(
&self,
key0: Arc<InterfaceTypeDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_implements_interfaces(
&self,
key0: String,
key1: Vec<ImplementsInterface>
) -> Vec<ApolloDiagnostic>;
fn validate_directive_definitions(&self) -> Vec<ApolloDiagnostic>;
fn validate_directives(
&self,
key0: Vec<Directive>,
key1: DirectiveLocation,
key2: Arc<Vec<VariableDefinition>>
) -> Vec<ApolloDiagnostic>;
fn validate_input_object_definitions(&self) -> Vec<ApolloDiagnostic>;
fn validate_input_object_definition(
&self,
key0: Arc<InputObjectTypeDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_input_values(
&self,
key0: Arc<Vec<InputValueDefinition>>,
key1: DirectiveLocation
) -> Vec<ApolloDiagnostic>;
fn validate_object_type_definitions(&self) -> Vec<ApolloDiagnostic>;
fn validate_extensions(&self) -> Vec<ApolloDiagnostic>;
fn validate_subscription_operations(
&self,
key0: Arc<Vec<Arc<OperationDefinition>>>
) -> Vec<ApolloDiagnostic>;
fn validate_query_operations(
&self,
key0: Arc<Vec<Arc<OperationDefinition>>>
) -> Vec<ApolloDiagnostic>;
fn validate_mutation_operations(
&self,
key0: Arc<Vec<Arc<OperationDefinition>>>
) -> Vec<ApolloDiagnostic>;
fn validate_object_type_definition(
&self,
key0: Arc<ObjectTypeDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_field_definitions(
&self,
key0: Vec<FieldDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_field_definition(
&self,
key0: FieldDefinition
) -> Vec<ApolloDiagnostic>;
fn validate_field(
&self,
key0: Arc<Field>,
key1: Arc<Vec<VariableDefinition>>
) -> Vec<ApolloDiagnostic>;
fn validate_leaf_field_selection(
&self,
key0: Arc<Field>,
key1: Type
) -> Result<(), ApolloDiagnostic>;
fn validate_arguments_definition(
&self,
key0: ArgumentsDefinition,
key1: DirectiveLocation
) -> Vec<ApolloDiagnostic>;
fn validate_arguments(&self, key0: Vec<Argument>) -> Vec<ApolloDiagnostic>;
fn validate_operation_definitions(
&self,
key0: FileId
) -> Vec<ApolloDiagnostic>;
fn get_possible_types(&self, key0: TypeDefinition) -> Vec<TypeDefinition>;
fn validate_fragment_selection(
&self,
key0: FragmentSelection
) -> Vec<ApolloDiagnostic>;
fn validate_fragment_spread(
&self,
key0: Arc<FragmentSpread>,
key1: Arc<Vec<VariableDefinition>>
) -> Vec<ApolloDiagnostic>;
fn validate_inline_fragment(
&self,
key0: Arc<InlineFragment>,
key1: Arc<Vec<VariableDefinition>>
) -> Vec<ApolloDiagnostic>;
fn validate_fragment_definition(
&self,
key0: Arc<FragmentDefinition>,
key1: Arc<Vec<VariableDefinition>>
) -> Vec<ApolloDiagnostic>;
fn validate_fragment_cycles(
&self,
key0: Arc<FragmentDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_fragment_type_condition(
&self,
key0: String,
key1: HirNodeLocation
) -> Vec<ApolloDiagnostic>;
fn validate_fragment_used(
&self,
key0: Arc<FragmentDefinition>,
key1: FileId
) -> Vec<ApolloDiagnostic>;
fn validate_selection_set(
&self,
key0: SelectionSet,
key1: Arc<Vec<VariableDefinition>>
) -> Vec<ApolloDiagnostic>;
fn validate_selection(
&self,
key0: Arc<Vec<Selection>>,
key1: Arc<Vec<VariableDefinition>>
) -> Vec<ApolloDiagnostic>;
fn validate_variable_definitions(
&self,
key0: Vec<VariableDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_unused_variable(
&self,
key0: Arc<OperationDefinition>
) -> Vec<ApolloDiagnostic>;
fn validate_variable_usage(
&self,
key0: InputValueDefinition,
key1: Arc<Vec<VariableDefinition>>,
key2: Argument
) -> Result<(), ApolloDiagnostic>;
fn validate_values(
&self,
key0: &Type,
key1: &Argument,
key2: Arc<Vec<VariableDefinition>>
) -> Result<(), Vec<ApolloDiagnostic>>;
fn same_response_shape(
&self,
key0: Arc<Field>,
key1: Arc<Field>
) -> Result<(), ApolloDiagnostic>;
fn fields_in_set_can_merge(
&self,
key0: SelectionSet
) -> Result<(), Vec<ApolloDiagnostic>>;
}
Required Methods§
sourcefn validate(&self) -> Vec<ApolloDiagnostic>
fn validate(&self) -> Vec<ApolloDiagnostic>
Validate all documents.
sourcefn validate_type_system(&self) -> Vec<ApolloDiagnostic>
fn validate_type_system(&self) -> Vec<ApolloDiagnostic>
Validate the type system, combined of all type system documents known to the compiler.
sourcefn validate_executable(&self, key0: FileId) -> Vec<ApolloDiagnostic>
fn validate_executable(&self, key0: FileId) -> Vec<ApolloDiagnostic>
Validate an executable document.
fn validate_name_uniqueness(&self) -> Vec<ApolloDiagnostic>
fn validate_schema_definition( &self, key0: Arc<SchemaDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_root_operation_definitions( &self, key0: Vec<RootOperationTypeDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_scalar_definitions(&self) -> Vec<ApolloDiagnostic>
fn validate_scalar_definition( &self, key0: Arc<ScalarTypeDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_enum_definitions(&self) -> Vec<ApolloDiagnostic>
fn validate_enum_definition( &self, key0: Arc<EnumTypeDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_enum_value( &self, key0: EnumValueDefinition ) -> Vec<ApolloDiagnostic>
fn validate_union_definitions(&self) -> Vec<ApolloDiagnostic>
fn validate_union_definition( &self, key0: Arc<UnionTypeDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_interface_definitions(&self) -> Vec<ApolloDiagnostic>
fn validate_interface_definition( &self, key0: Arc<InterfaceTypeDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_implements_interfaces( &self, key0: String, key1: Vec<ImplementsInterface> ) -> Vec<ApolloDiagnostic>
fn validate_directive_definitions(&self) -> Vec<ApolloDiagnostic>
fn validate_directives( &self, key0: Vec<Directive>, key1: DirectiveLocation, key2: Arc<Vec<VariableDefinition>> ) -> Vec<ApolloDiagnostic>
fn validate_input_object_definitions(&self) -> Vec<ApolloDiagnostic>
fn validate_input_object_definition( &self, key0: Arc<InputObjectTypeDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_input_values( &self, key0: Arc<Vec<InputValueDefinition>>, key1: DirectiveLocation ) -> Vec<ApolloDiagnostic>
fn validate_object_type_definitions(&self) -> Vec<ApolloDiagnostic>
fn validate_extensions(&self) -> Vec<ApolloDiagnostic>
fn validate_subscription_operations( &self, key0: Arc<Vec<Arc<OperationDefinition>>> ) -> Vec<ApolloDiagnostic>
fn validate_query_operations( &self, key0: Arc<Vec<Arc<OperationDefinition>>> ) -> Vec<ApolloDiagnostic>
fn validate_mutation_operations( &self, key0: Arc<Vec<Arc<OperationDefinition>>> ) -> Vec<ApolloDiagnostic>
fn validate_object_type_definition( &self, key0: Arc<ObjectTypeDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_field_definitions( &self, key0: Vec<FieldDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_field_definition( &self, key0: FieldDefinition ) -> Vec<ApolloDiagnostic>
fn validate_field( &self, key0: Arc<Field>, key1: Arc<Vec<VariableDefinition>> ) -> Vec<ApolloDiagnostic>
fn validate_leaf_field_selection( &self, key0: Arc<Field>, key1: Type ) -> Result<(), ApolloDiagnostic>
fn validate_arguments_definition( &self, key0: ArgumentsDefinition, key1: DirectiveLocation ) -> Vec<ApolloDiagnostic>
fn validate_arguments(&self, key0: Vec<Argument>) -> Vec<ApolloDiagnostic>
fn validate_operation_definitions(&self, key0: FileId) -> Vec<ApolloDiagnostic>
sourcefn get_possible_types(&self, key0: TypeDefinition) -> Vec<TypeDefinition>
fn get_possible_types(&self, key0: TypeDefinition) -> Vec<TypeDefinition>
Given a type definition, find all the types that can be used for fragment spreading.
Spec: https://spec.graphql.org/October2021/#GetPossibleTypes()
fn validate_fragment_selection( &self, key0: FragmentSelection ) -> Vec<ApolloDiagnostic>
fn validate_fragment_spread( &self, key0: Arc<FragmentSpread>, key1: Arc<Vec<VariableDefinition>> ) -> Vec<ApolloDiagnostic>
fn validate_inline_fragment( &self, key0: Arc<InlineFragment>, key1: Arc<Vec<VariableDefinition>> ) -> Vec<ApolloDiagnostic>
fn validate_fragment_definition( &self, key0: Arc<FragmentDefinition>, key1: Arc<Vec<VariableDefinition>> ) -> Vec<ApolloDiagnostic>
fn validate_fragment_cycles( &self, key0: Arc<FragmentDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_fragment_type_condition( &self, key0: String, key1: HirNodeLocation ) -> Vec<ApolloDiagnostic>
fn validate_fragment_used( &self, key0: Arc<FragmentDefinition>, key1: FileId ) -> Vec<ApolloDiagnostic>
fn validate_selection_set( &self, key0: SelectionSet, key1: Arc<Vec<VariableDefinition>> ) -> Vec<ApolloDiagnostic>
fn validate_selection( &self, key0: Arc<Vec<Selection>>, key1: Arc<Vec<VariableDefinition>> ) -> Vec<ApolloDiagnostic>
fn validate_variable_definitions( &self, key0: Vec<VariableDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_unused_variable( &self, key0: Arc<OperationDefinition> ) -> Vec<ApolloDiagnostic>
fn validate_variable_usage( &self, key0: InputValueDefinition, key1: Arc<Vec<VariableDefinition>>, key2: Argument ) -> Result<(), ApolloDiagnostic>
fn validate_values( &self, key0: &Type, key1: &Argument, key2: Arc<Vec<VariableDefinition>> ) -> Result<(), Vec<ApolloDiagnostic>>
sourcefn same_response_shape(
&self,
key0: Arc<Field>,
key1: Arc<Field>
) -> Result<(), ApolloDiagnostic>
fn same_response_shape( &self, key0: Arc<Field>, key1: Arc<Field> ) -> Result<(), ApolloDiagnostic>
Check if two fields will output the same type.
If the two fields output different types, returns an Err
containing diagnostic information.
To simply check if outputs are the same, you can use .is_ok()
:
let is_same = db.same_response_shape(field_a, field_b).is_ok();
// `is_same` is `bool`
Spec: https://spec.graphql.org/October2021/#SameResponseShape()
sourcefn fields_in_set_can_merge(
&self,
key0: SelectionSet
) -> Result<(), Vec<ApolloDiagnostic>>
fn fields_in_set_can_merge( &self, key0: SelectionSet ) -> Result<(), Vec<ApolloDiagnostic>>
Check if the fields in a given selection set can be merged.
If the fields cannot be merged, returns an Err
containing diagnostic information.
Spec: https://spec.graphql.org/October2021/#FieldsInSetCanMerge()