Skip to content

Commit

Permalink
Apply suggestion
Browse files Browse the repository at this point in the history
Co-Authored-By: yaacovCR <[email protected]>
  • Loading branch information
JoviDeCroock and yaacovCR committed Jun 19, 2024
1 parent f6fd3cf commit 002a2ad
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/validation/rules/OverlappingFieldsCanBeMergedRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,24 +485,27 @@ function findConflictsBetweenSubSelectionSets(

// (E) Then collect any conflicts between the provided collection of fields
// and any fragment names found in the given fragment.
const processDiscoveredFragments = (
function processDiscoveredFragments(
context: ValidationContext,
conflicts: Array<Conflict>,
cachedFieldsAndFragmentNames: Map<SelectionSetNode, FieldsAndFragmentNames>,
comparedFragmentPairs: PairSet,
areMutuallyExclusive: boolean,
fieldMap: NodeAndDefCollection,
discoveredFragments: Array<Array<string>>,
) => {
while (discoveredFragments.length !== 0) {
const item = discoveredFragments.pop();
) {
let item;
while ((item = discoveredFragments.pop()) !== undefined) {
const [fragmentName, referencedFragmentName] = item;
if (
!item ||
comparedFragmentPairs.has(item[1], item[0], areMutuallyExclusive)
comparedFragmentPairs.has(
referencedFragmentName,
fragmentName,
areMutuallyExclusive,
)
) {
continue;
}
const [fragmentName, referencedFragmentName] = item;
comparedFragmentPairs.add(
referencedFragmentName,
fragmentName,
Expand All @@ -519,7 +522,7 @@ const processDiscoveredFragments = (
discoveredFragments,
);
}
};
}

// Collect all Conflicts "within" one collection of fields.
function collectConflictsWithin(
Expand Down

0 comments on commit 002a2ad

Please sign in to comment.