specifiedRules.mjs 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Spec Section: "Executable Definitions"
  2. import { ExecutableDefinitions } from './rules/ExecutableDefinitions'; // Spec Section: "Operation Name Uniqueness"
  3. import { UniqueOperationNames } from './rules/UniqueOperationNames'; // Spec Section: "Lone Anonymous Operation"
  4. import { LoneAnonymousOperation } from './rules/LoneAnonymousOperation'; // Spec Section: "Subscriptions with Single Root Field"
  5. import { SingleFieldSubscriptions } from './rules/SingleFieldSubscriptions'; // Spec Section: "Fragment Spread Type Existence"
  6. import { KnownTypeNames } from './rules/KnownTypeNames'; // Spec Section: "Fragments on Composite Types"
  7. import { FragmentsOnCompositeTypes } from './rules/FragmentsOnCompositeTypes'; // Spec Section: "Variables are Input Types"
  8. import { VariablesAreInputTypes } from './rules/VariablesAreInputTypes'; // Spec Section: "Leaf Field Selections"
  9. import { ScalarLeafs } from './rules/ScalarLeafs'; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types"
  10. import { FieldsOnCorrectType } from './rules/FieldsOnCorrectType'; // Spec Section: "Fragment Name Uniqueness"
  11. import { UniqueFragmentNames } from './rules/UniqueFragmentNames'; // Spec Section: "Fragment spread target defined"
  12. import { KnownFragmentNames } from './rules/KnownFragmentNames'; // Spec Section: "Fragments must be used"
  13. import { NoUnusedFragments } from './rules/NoUnusedFragments'; // Spec Section: "Fragment spread is possible"
  14. import { PossibleFragmentSpreads } from './rules/PossibleFragmentSpreads'; // Spec Section: "Fragments must not form cycles"
  15. import { NoFragmentCycles } from './rules/NoFragmentCycles'; // Spec Section: "Variable Uniqueness"
  16. import { UniqueVariableNames } from './rules/UniqueVariableNames'; // Spec Section: "All Variable Used Defined"
  17. import { NoUndefinedVariables } from './rules/NoUndefinedVariables'; // Spec Section: "All Variables Used"
  18. import { NoUnusedVariables } from './rules/NoUnusedVariables'; // Spec Section: "Directives Are Defined"
  19. import { KnownDirectives } from './rules/KnownDirectives'; // Spec Section: "Directives Are Unique Per Location"
  20. import { UniqueDirectivesPerLocation } from './rules/UniqueDirectivesPerLocation'; // Spec Section: "Argument Names"
  21. import { KnownArgumentNames, KnownArgumentNamesOnDirectives } from // @internal
  22. './rules/KnownArgumentNames'; // Spec Section: "Argument Uniqueness"
  23. import { UniqueArgumentNames } from './rules/UniqueArgumentNames'; // Spec Section: "Value Type Correctness"
  24. import { ValuesOfCorrectType } from './rules/ValuesOfCorrectType'; // Spec Section: "Argument Optionality"
  25. import { ProvidedRequiredArguments, ProvidedRequiredArgumentsOnDirectives } from // @internal
  26. './rules/ProvidedRequiredArguments'; // Spec Section: "All Variable Usages Are Allowed"
  27. import { VariablesInAllowedPosition } from './rules/VariablesInAllowedPosition'; // Spec Section: "Field Selection Merging"
  28. import { OverlappingFieldsCanBeMerged } from './rules/OverlappingFieldsCanBeMerged'; // Spec Section: "Input Object Field Uniqueness"
  29. import { UniqueInputFieldNames } from './rules/UniqueInputFieldNames';
  30. /**
  31. * This set includes all validation rules defined by the GraphQL spec.
  32. *
  33. * The order of the rules in this list has been adjusted to lead to the
  34. * most clear output when encountering multiple validation errors.
  35. */
  36. export var specifiedRules = Object.freeze([ExecutableDefinitions, UniqueOperationNames, LoneAnonymousOperation, SingleFieldSubscriptions, KnownTypeNames, FragmentsOnCompositeTypes, VariablesAreInputTypes, ScalarLeafs, FieldsOnCorrectType, UniqueFragmentNames, KnownFragmentNames, NoUnusedFragments, PossibleFragmentSpreads, NoFragmentCycles, UniqueVariableNames, NoUndefinedVariables, NoUnusedVariables, KnownDirectives, UniqueDirectivesPerLocation, KnownArgumentNames, UniqueArgumentNames, ValuesOfCorrectType, ProvidedRequiredArguments, VariablesInAllowedPosition, OverlappingFieldsCanBeMerged, UniqueInputFieldNames]);
  37. import { LoneSchemaDefinition } from './rules/LoneSchemaDefinition';
  38. import { UniqueOperationTypes } from './rules/UniqueOperationTypes';
  39. import { UniqueTypeNames } from './rules/UniqueTypeNames';
  40. import { UniqueEnumValueNames } from './rules/UniqueEnumValueNames';
  41. import { UniqueFieldDefinitionNames } from './rules/UniqueFieldDefinitionNames';
  42. import { UniqueDirectiveNames } from './rules/UniqueDirectiveNames';
  43. import { PossibleTypeExtensions } from './rules/PossibleTypeExtensions'; // @internal
  44. export var specifiedSDLRules = Object.freeze([LoneSchemaDefinition, UniqueOperationTypes, UniqueTypeNames, UniqueEnumValueNames, UniqueFieldDefinitionNames, UniqueDirectiveNames, KnownTypeNames, KnownDirectives, UniqueDirectivesPerLocation, PossibleTypeExtensions, KnownArgumentNamesOnDirectives, UniqueArgumentNames, UniqueInputFieldNames, ProvidedRequiredArgumentsOnDirectives]);