Skip to content

Commit

Permalink
validation: Add missing rule exports (#2400)
Browse files Browse the repository at this point in the history
Backport of #2399 on `14.x.x` branch
  • Loading branch information
IvanGoncharov authored Jan 26, 2020
1 parent b4bff0b commit 84f8018
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ export {
// All validation rules in the GraphQL Specification.
specifiedRules,
// Individual validation rules.
ExecutableDefinitionsRule,
FieldsOnCorrectTypeRule,
FragmentsOnCompositeTypesRule,
KnownArgumentNamesRule,
Expand All @@ -325,6 +326,14 @@ export {
ValuesOfCorrectTypeRule,
VariablesAreInputTypesRule,
VariablesInAllowedPositionRule,
// SDL-specific validation rules
LoneSchemaDefinitionRule,
UniqueOperationTypesRule,
UniqueTypeNamesRule,
UniqueEnumValueNamesRule,
UniqueFieldDefinitionNamesRule,
UniqueDirectiveNamesRule,
PossibleTypeExtensionsRule,
} from './validation';

export type { ValidationRule } from './validation';
Expand Down
28 changes: 28 additions & 0 deletions src/validation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ export type { ValidationRule } from './ValidationContext';
// All validation rules in the GraphQL Specification.
export { specifiedRules } from './specifiedRules';

// Spec Section: "Executable Definitions"
export {
ExecutableDefinitions as ExecutableDefinitionsRule,
} from './rules/ExecutableDefinitions';

// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types"
export {
FieldsOnCorrectType as FieldsOnCorrectTypeRule,
Expand Down Expand Up @@ -128,3 +133,26 @@ export {
export {
VariablesInAllowedPosition as VariablesInAllowedPositionRule,
} from './rules/VariablesInAllowedPosition';

// SDL-specific validation rules
export {
LoneSchemaDefinition as LoneSchemaDefinitionRule,
} from './rules/LoneSchemaDefinition';
export {
UniqueOperationTypes as UniqueOperationTypesRule,
} from './rules/UniqueOperationTypes';
export {
UniqueTypeNames as UniqueTypeNamesRule,
} from './rules/UniqueTypeNames';
export {
UniqueEnumValueNames as UniqueEnumValueNamesRule,
} from './rules/UniqueEnumValueNames';
export {
UniqueFieldDefinitionNames as UniqueFieldDefinitionNamesRule,
} from './rules/UniqueFieldDefinitionNames';
export {
UniqueDirectiveNames as UniqueDirectiveNamesRule,
} from './rules/UniqueDirectiveNames';
export {
PossibleTypeExtensions as PossibleTypeExtensionsRule,
} from './rules/PossibleTypeExtensions';
9 changes: 9 additions & 0 deletions tstypes/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ export {
// All validation rules in the GraphQL Specification.
specifiedRules,
// Individual validation rules.
ExecutableDefinitionsRule,
FieldsOnCorrectTypeRule,
FragmentsOnCompositeTypesRule,
KnownArgumentNamesRule,
Expand All @@ -327,6 +328,14 @@ export {
ValuesOfCorrectTypeRule,
VariablesAreInputTypesRule,
VariablesInAllowedPositionRule,
// SDL-specific validation rules
LoneSchemaDefinitionRule,
UniqueOperationTypesRule,
UniqueTypeNamesRule,
UniqueEnumValueNamesRule,
UniqueFieldDefinitionNamesRule,
UniqueDirectiveNamesRule,
PossibleTypeExtensionsRule,
ValidationRule,
} from './validation';

Expand Down
28 changes: 28 additions & 0 deletions tstypes/validation/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ export { ValidationContext, ValidationRule } from './ValidationContext';

export { specifiedRules } from './specifiedRules';

// Spec Section: "Executable Definitions"
export {
ExecutableDefinitions as ExecutableDefinitionsRule,
} from './rules/ExecutableDefinitions';

// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types"
export {
FieldsOnCorrectType as FieldsOnCorrectTypeRule,
Expand Down Expand Up @@ -124,3 +129,26 @@ export {
export {
VariablesInAllowedPosition as VariablesInAllowedPositionRule,
} from './rules/VariablesInAllowedPosition';

// SDL-specific validation rules
export {
LoneSchemaDefinition as LoneSchemaDefinitionRule,
} from './rules/LoneSchemaDefinition';
export {
UniqueOperationTypes as UniqueOperationTypesRule,
} from './rules/UniqueOperationTypes';
export {
UniqueTypeNames as UniqueTypeNamesRule,
} from './rules/UniqueTypeNames';
export {
UniqueEnumValueNames as UniqueEnumValueNamesRule,
} from './rules/UniqueEnumValueNames';
export {
UniqueFieldDefinitionNames as UniqueFieldDefinitionNamesRule,
} from './rules/UniqueFieldDefinitionNames';
export {
UniqueDirectiveNames as UniqueDirectiveNamesRule,
} from './rules/UniqueDirectiveNames';
export {
PossibleTypeExtensions as PossibleTypeExtensionsRule,
} from './rules/PossibleTypeExtensions';

0 comments on commit 84f8018

Please sign in to comment.