Skip to content

Commit

Permalink
fix: do not merge batched items with 1 item as a single item fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
devsergiy committed Nov 5, 2023
1 parent 00eb593 commit 5721373
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions v2/pkg/engine/resolve/v2load.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
"sync"

"github.com/pkg/errors"
"golang.org/x/sync/errgroup"

"github.com/wundergraph/graphql-go-tools/v2/pkg/astjson"
"github.com/wundergraph/graphql-go-tools/v2/pkg/pool"
"golang.org/x/sync/errgroup"
)

type V2Loader struct {
Expand Down Expand Up @@ -325,7 +326,7 @@ func (l *V2Loader) mergeResult(res *result, items []int) error {
l.data.RootNode = node
return nil
}
if len(items) == 1 {
if len(items) == 1 && res.batchStats == nil {
l.data.MergeNodesWithPath(items[0], node, res.postProcessing.MergePath)
return nil
}
Expand Down

0 comments on commit 5721373

Please sign in to comment.