Module: GraphQL::StaticValidation

Defined in:
lib/graphql/static_validation/error.rb,
lib/graphql/static_validation/all_rules.rb,
lib/graphql/static_validation/validator.rb,
lib/graphql/static_validation/type_stack.rb,
lib/graphql/static_validation/base_visitor.rb,
lib/graphql/static_validation/literal_validator.rb,
lib/graphql/static_validation/validation_context.rb,
lib/graphql/static_validation/interpreter_visitor.rb,
lib/graphql/static_validation/definition_dependencies.rb,
lib/graphql/static_validation/rules/fields_will_merge.rb,
lib/graphql/static_validation/rules/query_root_exists.rb,
lib/graphql/static_validation/rules/fragments_are_used.rb,
lib/graphql/static_validation/validation_timeout_error.rb,
lib/graphql/static_validation/rules/fragments_are_named.rb,
lib/graphql/static_validation/rules/fragment_types_exist.rb,
lib/graphql/static_validation/rules/fragments_are_finite.rb,
lib/graphql/static_validation/rules/mutation_root_exists.rb,
lib/graphql/static_validation/rules/arguments_are_defined.rb,
lib/graphql/static_validation/rules/directives_are_defined.rb,
lib/graphql/static_validation/rules/fields_will_merge_error.rb,
lib/graphql/static_validation/rules/query_root_exists_error.rb,
lib/graphql/static_validation/rules/fragments_are_used_error.rb,
lib/graphql/static_validation/rules/subscription_root_exists.rb,
lib/graphql/static_validation/rules/argument_names_are_unique.rb,
lib/graphql/static_validation/rules/fragment_names_are_unique.rb,
lib/graphql/static_validation/rules/fragments_are_named_error.rb,
lib/graphql/static_validation/rules/operation_names_are_valid.rb,
lib/graphql/static_validation/rules/variable_names_are_unique.rb,
lib/graphql/static_validation/rules/variables_are_input_types.rb,
lib/graphql/static_validation/rules/fields_are_defined_on_type.rb,
lib/graphql/static_validation/rules/fragment_types_exist_error.rb,
lib/graphql/static_validation/rules/fragments_are_finite_error.rb,
lib/graphql/static_validation/rules/mutation_root_exists_error.rb,
lib/graphql/static_validation/rules/no_definitions_are_present.rb,
lib/graphql/static_validation/rules/arguments_are_defined_error.rb,
lib/graphql/static_validation/rules/variable_usages_are_allowed.rb,
lib/graphql/static_validation/rules/directives_are_defined_error.rb,
lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb,
lib/graphql/static_validation/rules/input_object_names_are_unique.rb,
lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb,
lib/graphql/static_validation/rules/required_arguments_are_present.rb,
lib/graphql/static_validation/rules/subscription_root_exists_error.rb,
lib/graphql/static_validation/rules/unique_directives_per_location.rb,
lib/graphql/static_validation/rules/variables_are_used_and_defined.rb,
lib/graphql/static_validation/rules/argument_names_are_unique_error.rb,
lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb,
lib/graphql/static_validation/rules/operation_names_are_valid_error.rb,
lib/graphql/static_validation/rules/variable_names_are_unique_error.rb,
lib/graphql/static_validation/rules/variables_are_input_types_error.rb,
lib/graphql/static_validation/rules/argument_literals_are_compatible.rb,
lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb,
lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb,
lib/graphql/static_validation/rules/no_definitions_are_present_error.rb,
lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb,
lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb,
lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb,
lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb,
lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb,
lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb,
lib/graphql/static_validation/rules/required_arguments_are_present_error.rb,
lib/graphql/static_validation/rules/unique_directives_per_location_error.rb,
lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb,
lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb,
lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb,
lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb,
lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb,
lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb,
lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb,
lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb,
lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb

Defined Under Namespace

Modules: ArgumentLiteralsAreCompatible, ArgumentNamesAreUnique, ArgumentsAreDefined, DefinitionDependencies, DirectivesAreDefined, DirectivesAreInValidLocations, FieldsAreDefinedOnType, FieldsHaveAppropriateSelections, FieldsWillMerge, FragmentNamesAreUnique, FragmentSpreadsArePossible, FragmentTypesExist, FragmentsAreFinite, FragmentsAreNamed, FragmentsAreOnCompositeTypes, FragmentsAreUsed, InputObjectNamesAreUnique, MutationRootExists, NoDefinitionsArePresent, OneOfInputObjectsAreValid, OperationNamesAreValid, QueryRootExists, RequiredArgumentsArePresent, RequiredInputObjectAttributesArePresent, SubscriptionRootExists, UniqueDirectivesPerLocation, VariableDefaultValuesAreCorrectlyTyped, VariableNamesAreUnique, VariableUsagesAreAllowed, VariablesAreInputTypes, VariablesAreUsedAndDefined Classes: ArgumentLiteralsAreCompatibleError, ArgumentNamesAreUniqueError, ArgumentsAreDefinedError, BaseVisitor, DirectivesAreDefinedError, DirectivesAreInValidLocationsError, Error, FieldsAreDefinedOnTypeError, FieldsHaveAppropriateSelectionsError, FieldsWillMergeError, FragmentNamesAreUniqueError, FragmentSpreadsArePossibleError, FragmentTypesExistError, FragmentsAreFiniteError, FragmentsAreNamedError, FragmentsAreOnCompositeTypesError, FragmentsAreUsedError, InputObjectNamesAreUniqueError, InterpreterVisitor, LiteralValidator, MutationRootExistsError, NoDefinitionsArePresentError, OneOfInputObjectsAreValidError, OperationNamesAreValidError, QueryRootExistsError, RequiredArgumentsArePresentError, RequiredInputObjectAttributesArePresentError, SubscriptionRootExistsError, TypeStack, UniqueDirectivesPerLocationError, ValidationContext, ValidationTimeoutError, Validator, VariableDefaultValuesAreCorrectlyTypedError, VariableNamesAreUniqueError, VariableUsagesAreAllowedError, VariablesAreInputTypesError, VariablesAreUsedAndDefinedError

Constant Summary collapse

ALL_RULES =

Default rules for Validator

Order is important here. Some validators return Language::Visitor::SKIP which stops the visit on that node. That way it doesn’t try to find fields on types that don’t exist, etc.

[
  GraphQL::StaticValidation::NoDefinitionsArePresent,
  GraphQL::StaticValidation::DirectivesAreDefined,
  GraphQL::StaticValidation::DirectivesAreInValidLocations,
  GraphQL::StaticValidation::UniqueDirectivesPerLocation,
  GraphQL::StaticValidation::OperationNamesAreValid,
  GraphQL::StaticValidation::FragmentNamesAreUnique,
  GraphQL::StaticValidation::FragmentsAreFinite,
  GraphQL::StaticValidation::FragmentsAreNamed,
  GraphQL::StaticValidation::FragmentsAreUsed,
  GraphQL::StaticValidation::FragmentTypesExist,
  GraphQL::StaticValidation::FragmentsAreOnCompositeTypes,
  GraphQL::StaticValidation::FragmentSpreadsArePossible,
  GraphQL::StaticValidation::FieldsAreDefinedOnType,
  GraphQL::StaticValidation::FieldsWillMerge,
  GraphQL::StaticValidation::FieldsHaveAppropriateSelections,
  GraphQL::StaticValidation::ArgumentsAreDefined,
  GraphQL::StaticValidation::ArgumentLiteralsAreCompatible,
  GraphQL::StaticValidation::RequiredArgumentsArePresent,
  GraphQL::StaticValidation::RequiredInputObjectAttributesArePresent,
  GraphQL::StaticValidation::ArgumentNamesAreUnique,
  GraphQL::StaticValidation::VariableNamesAreUnique,
  GraphQL::StaticValidation::VariablesAreInputTypes,
  GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTyped,
  GraphQL::StaticValidation::VariablesAreUsedAndDefined,
  GraphQL::StaticValidation::VariableUsagesAreAllowed,
  GraphQL::StaticValidation::MutationRootExists,
  GraphQL::StaticValidation::QueryRootExists,
  GraphQL::StaticValidation::SubscriptionRootExists,
  GraphQL::StaticValidation::InputObjectNamesAreUnique,
  GraphQL::StaticValidation::OneOfInputObjectsAreValid,
]