Skip to content

Commit 2a9532c

Browse files
committed
use specified rules instead of default set
1 parent 376fb7a commit 2a9532c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

graphql/src/runner.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use graph::{
2121
data::query::{QueryResults, QueryTarget},
2222
prelude::QueryStore,
2323
};
24-
use graphql_tools::validation::rules::default_rules_validation_plan;
24+
use graphql_tools::validation::rules::{default_rules_validation_plan, LoneAnonymousOperation, FragmentsOnCompositeTypes, OverlappingFieldsCanBeMerged};
2525
use graphql_tools::validation::validate::{validate, ValidationPlan};
2626

2727
use lazy_static::lazy_static;
@@ -138,11 +138,13 @@ where
138138
) -> Self {
139139
let logger = logger.new(o!("component" => "GraphQlRunner"));
140140
let result_size = Arc::new(ResultSizeMetrics::new(registry));
141-
// This is created only once, and includes the following rules at the moment:
142-
// LoneAnonymousOperation
143-
// FragmentsOnCompositeTypes
144-
// OverlappingFieldsCanBeMerged
145-
let graphql_validation_plan = default_rules_validation_plan();
141+
let mut graphql_validation_plan = ValidationPlan {
142+
rules: Vec::new()
143+
};
144+
145+
graphql_validation_plan.add_rule(Box::new(LoneAnonymousOperation {}));
146+
graphql_validation_plan.add_rule(Box::new(FragmentsOnCompositeTypes {}));
147+
graphql_validation_plan.add_rule(Box::new(OverlappingFieldsCanBeMerged {}));
146148

147149
GraphQlRunner {
148150
logger,

0 commit comments

Comments
 (0)