Skip to content

Commit

Permalink
move field selection normalization after merging inline fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
devsergiy committed Dec 15, 2023
1 parent 037d76b commit 49b34ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v2/pkg/astnormalization/astnormalization.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@ func (o *OperationNormalizer) setupOperationWalkers() {
other := astvisitor.NewWalker(48)
removeSelfAliasing(&other)
inlineSelectionsFromInlineFragments(&other)
mergeFieldSelections(&other)
o.operationWalkers = append(o.operationWalkers, walkerStage{
name: "removeSelfAliasing, inlineSelectionsFromInlineFragments, mergeFieldSelections",
name: "removeSelfAliasing, inlineSelectionsFromInlineFragments",
walker: &other,
})

Expand All @@ -238,6 +237,7 @@ func (o *OperationNormalizer) setupOperationWalkers() {
})

cleanup := astvisitor.NewWalker(48)
mergeFieldSelections(&cleanup)
deduplicateFields(&cleanup)
if o.options.removeFragmentDefinitions {
removeFragmentDefinitions(&cleanup)
Expand All @@ -246,7 +246,7 @@ func (o *OperationNormalizer) setupOperationWalkers() {
deleteUnusedVariables(&cleanup)
}
o.operationWalkers = append(o.operationWalkers, walkerStage{
name: "deduplicateFields, removeFragmentDefinitions, deleteUnusedVariables",
name: "mergeFieldSelections, deduplicateFields, removeFragmentDefinitions, deleteUnusedVariables",
walker: &cleanup,
})

Expand Down

0 comments on commit 49b34ba

Please sign in to comment.