Skip to content

Commit 2fc5394

Browse files
committed
fix KnownFragmentNames name
1 parent f4cdfab commit 2fc5394

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/validation/rules/defaults.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::validation::validate::ValidationPlan;
22

33
use super::{
4-
FieldsOnCorrectType, FragmentsOnCompositeTypes, KnownFragmentNamesRule, KnownTypeNames,
4+
FieldsOnCorrectType, FragmentsOnCompositeTypes, KnownFragmentNames, KnownTypeNames,
55
LeafFieldSelections, LoneAnonymousOperation, NoUnusedFragments, OverlappingFieldsCanBeMerged,
66
SingleFieldSubscriptions, UniqueFragmentNames, UniqueOperationNames, VariablesAreInputTypes,
77
};
@@ -12,7 +12,7 @@ pub fn default_rules_validation_plan() -> ValidationPlan {
1212
plan.add_rule(Box::new(LoneAnonymousOperation {}));
1313
plan.add_rule(Box::new(KnownTypeNames {}));
1414
plan.add_rule(Box::new(FieldsOnCorrectType {}));
15-
plan.add_rule(Box::new(KnownFragmentNamesRule {}));
15+
plan.add_rule(Box::new(KnownFragmentNames {}));
1616
plan.add_rule(Box::new(FragmentsOnCompositeTypes {}));
1717
plan.add_rule(Box::new(OverlappingFieldsCanBeMerged {}));
1818
plan.add_rule(Box::new(NoUnusedFragments {}));

src/validation/rules/known_fragment_names.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use crate::{ast::QueryVisitor, validation::utils::ValidationContext};
99
/// to fragments defined in the same document.
1010
///
1111
/// See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined
12-
pub struct KnownFragmentNamesRule;
12+
pub struct KnownFragmentNames;
1313

14-
impl<'a> QueryVisitor<ValidationErrorContext<'a>> for KnownFragmentNamesRule {
14+
impl<'a> QueryVisitor<ValidationErrorContext<'a>> for KnownFragmentNames {
1515
fn enter_fragment_spread(
1616
&self,
1717
_node: &FragmentSpread,
@@ -29,7 +29,7 @@ impl<'a> QueryVisitor<ValidationErrorContext<'a>> for KnownFragmentNamesRule {
2929
}
3030
}
3131

32-
impl ValidationRule for KnownFragmentNamesRule {
32+
impl ValidationRule for KnownFragmentNames {
3333
fn validate<'a>(&self, ctx: &ValidationContext) -> Vec<ValidationError> {
3434
let mut error_context = ValidationErrorContext::new(ctx);
3535
self.visit_document(&ctx.operation.clone(), &mut error_context);
@@ -42,7 +42,7 @@ impl ValidationRule for KnownFragmentNamesRule {
4242
fn valid_fragment() {
4343
use crate::validation::test_utils::*;
4444

45-
let mut plan = create_plan_from_rule(Box::new(KnownFragmentNamesRule {}));
45+
let mut plan = create_plan_from_rule(Box::new(KnownFragmentNames {}));
4646
let errors = test_operation_without_schema(
4747
"{
4848
human(id: 4) {
@@ -75,7 +75,7 @@ fn valid_fragment() {
7575
fn invalid_fragment() {
7676
use crate::validation::test_utils::*;
7777

78-
let mut plan = create_plan_from_rule(Box::new(KnownFragmentNamesRule {}));
78+
let mut plan = create_plan_from_rule(Box::new(KnownFragmentNames {}));
7979
let errors = test_operation_without_schema(
8080
"{
8181
human(id: 4) {

0 commit comments

Comments
 (0)