From f6fd3cf6f93cdea0cccf76abb0a3428fd0629cc6 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Wed, 19 Jun 2024 10:21:11 +0200 Subject: [PATCH] delay procesing discovered fragments --- .../rules/OverlappingFieldsCanBeMergedRule.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts b/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts index 2f61e5b0e7..60d5c680e9 100644 --- a/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts +++ b/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts @@ -207,15 +207,6 @@ function findConflictsWithinSelectionSet( discoveredFragments, ); - processDiscoveredFragments( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFragmentPairs, - false, - fieldMap, - discoveredFragments, - ); // (C) Then compare this fragment with all other fragments found in this // selection set to collect conflicts between fragments spread together. // This compares each item in the list of fragment names to every other @@ -232,6 +223,16 @@ function findConflictsWithinSelectionSet( ); } } + + processDiscoveredFragments( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + false, + fieldMap, + discoveredFragments, + ); } return conflicts; }