Skip to content

Commit 680245f

Browse files
committed
cleanup
1 parent b4920da commit 680245f

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

v2/pkg/engine/datasource/graphql_datasource/graphql_datasource_defer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func TestGraphQLDataSourceDefer(t *testing.T) {
158158
},
159159
},
160160
planConfiguration,
161-
WithDefaultCustomPostProcessor(postprocess.DisableResolveInputTemplates(), postprocess.DisableCreateConcreteSingleFetchTypes(), postprocess.DisableCreateParallelNodes(), postprocess.DisableMergeFields(), postprocess.DisableDefer()),
161+
WithDefaultCustomPostProcessor(postprocess.DisableResolveInputTemplates(), postprocess.DisableCreateConcreteSingleFetchTypes(), postprocess.DisableCreateParallelNodes(), postprocess.DisableMergeFields(), postprocess.DisableExtractDeferFetches()),
162162
WithDefer(),
163163
WithCalculateFieldDependencies(),
164164
)
@@ -516,7 +516,7 @@ func TestGraphQLDataSourceDefer(t *testing.T) {
516516
},
517517
},
518518
planConfiguration,
519-
WithDefaultCustomPostProcessor(postprocess.DisableResolveInputTemplates(), postprocess.DisableCreateConcreteSingleFetchTypes(), postprocess.DisableCreateParallelNodes(), postprocess.DisableMergeFields(), postprocess.DisableDefer()),
519+
WithDefaultCustomPostProcessor(postprocess.DisableResolveInputTemplates(), postprocess.DisableCreateConcreteSingleFetchTypes(), postprocess.DisableCreateParallelNodes(), postprocess.DisableMergeFields(), postprocess.DisableExtractDeferFetches()),
520520
WithDefer(),
521521
WithCalculateFieldDependencies(),
522522
)

v2/pkg/engine/plan/plan.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ func (*SubscriptionResponsePlan) PlanKind() Kind {
4444
}
4545

4646
type DeferResponsePlan struct {
47-
Response *resolve.GraphQLResponse
48-
Defers []*resolve.DeferGraphQLResponse
49-
FlushInterval int64
47+
Response *resolve.GraphQLResponse
48+
Defers []*resolve.DeferGraphQLResponse
49+
FlushInterval int64
5050
}
5151

5252
func (d DeferResponsePlan) PlanKind() Kind {

v2/pkg/engine/postprocess/defer.go renamed to v2/pkg/engine/postprocess/extract_defer_fetches.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88
"github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve"
99
)
1010

11-
type deferProcessor struct {
11+
type extractDeferFetches struct {
1212
disable bool
1313
}
1414

15-
func (d *deferProcessor) Process(deferPlan *plan.DeferResponsePlan) {
15+
func (d *extractDeferFetches) Process(deferPlan *plan.DeferResponsePlan) {
1616
if d.disable {
1717
return
1818
}
@@ -40,7 +40,7 @@ func (d *deferProcessor) Process(deferPlan *plan.DeferResponsePlan) {
4040
}
4141
}
4242

43-
func (d *deferProcessor) fetchGroups(deferPlan *plan.DeferResponsePlan) (root []*resolve.FetchTreeNode, deffered map[string][]*resolve.FetchTreeNode) {
43+
func (d *extractDeferFetches) fetchGroups(deferPlan *plan.DeferResponsePlan) (root []*resolve.FetchTreeNode, deffered map[string][]*resolve.FetchTreeNode) {
4444
fetchGroups := make(map[string][]*resolve.FetchTreeNode)
4545

4646
for _, fetch := range deferPlan.Response.Fetches.ChildNodes {

v2/pkg/engine/postprocess/postprocess.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Processor struct {
2323
collectDataSourceInfo bool
2424
fetchTreeProcessors *FetchTreeProcessors
2525
responseTreeProcessors *ResponseTreeProcessors
26-
deferProcessor *deferProcessor
26+
extractDeferFetches *extractDeferFetches
2727
}
2828

2929
type FetchTreeProcessors struct {
@@ -68,7 +68,7 @@ type processorOptions struct {
6868
disableCreateParallelNodes bool
6969
disableAddMissingNestedDependencies bool
7070
collectDataSourceInfo bool
71-
disableDefer bool
71+
disableExtractDeferFetches bool
7272
}
7373

7474
type ProcessorOption func(*processorOptions)
@@ -122,9 +122,9 @@ func DisableAddMissingNestedDependencies() ProcessorOption {
122122
}
123123
}
124124

125-
func DisableDefer() ProcessorOption {
125+
func DisableExtractDeferFetches() ProcessorOption {
126126
return func(o *processorOptions) {
127-
o.disableDefer = true
127+
o.disableExtractDeferFetches = true
128128
}
129129
}
130130

@@ -166,8 +166,8 @@ func NewProcessor(options ...ProcessorOption) *Processor {
166166
disable: opts.disableMergeFields,
167167
},
168168
},
169-
deferProcessor: &deferProcessor{
170-
disable: opts.disableDefer,
169+
extractDeferFetches: &extractDeferFetches{
170+
disable: opts.disableExtractDeferFetches,
171171
},
172172
}
173173
}
@@ -191,7 +191,7 @@ func (p *Processor) Process(pre plan.Plan) {
191191
p.fetchTreeProcessors.processFlatFetchTree(t.Response.Fetches)
192192

193193
// extract deferred fetches into their own fetch trees
194-
p.deferProcessor.Process(t)
194+
p.extractDeferFetches.Process(t)
195195

196196
// process the initial response fetch tree
197197
p.fetchTreeProcessors.organizeFetchTree(t.Response.Fetches)

0 commit comments

Comments
 (0)