Skip to content

Commit 3d93511

Browse files
committed
Rename multipart-specific field to be more general
1 parent bf139fd commit 3d93511

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

v2/pkg/engine/resolve/event_loop_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,16 @@ func TestEventLoop(t *testing.T) {
119119
testReporter := &TestReporter{}
120120

121121
resolver := New(resolverCtx, ResolverOptions{
122-
MaxConcurrency: 1024,
123-
Debug: false,
124-
AsyncErrorWriter: ew,
125-
PropagateSubgraphErrors: false,
126-
PropagateSubgraphStatusCodes: false,
127-
SubgraphErrorPropagationMode: SubgraphErrorPropagationModePassThrough,
128-
DefaultErrorExtensionCode: "TEST",
129-
MaxRecyclableParserSize: 1024 * 1024,
130-
MultipartSubHeartbeatInterval: DefaultHeartbeatInterval,
131-
Reporter: testReporter,
122+
MaxConcurrency: 1024,
123+
Debug: false,
124+
AsyncErrorWriter: ew,
125+
PropagateSubgraphErrors: false,
126+
PropagateSubgraphStatusCodes: false,
127+
SubgraphErrorPropagationMode: SubgraphErrorPropagationModePassThrough,
128+
DefaultErrorExtensionCode: "TEST",
129+
MaxRecyclableParserSize: 1024 * 1024,
130+
SubHeartbeatInterval: DefaultHeartbeatInterval,
131+
Reporter: testReporter,
132132
})
133133

134134
subscription := &GraphQLSubscription{

v2/pkg/engine/resolve/resolve.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ type ResolverOptions struct {
139139
ResolvableOptions ResolvableOptions
140140
// AllowedCustomSubgraphErrorFields defines which fields are allowed in the subgraph error when in passthrough mode
141141
AllowedSubgraphErrorFields []string
142-
// MultipartSubHeartbeatInterval defines the interval in which a heartbeat is sent to all multipart subscriptions
143-
MultipartSubHeartbeatInterval time.Duration
142+
// SubHeartbeatInterval defines the interval in which a heartbeat is sent to all subscriptions (whether or not this does anything is determined by the subscription response writer)
143+
SubHeartbeatInterval time.Duration
144144
// MaxSubscriptionFetchTimeout defines the maximum time a subscription fetch can take before it is considered timed out
145145
MaxSubscriptionFetchTimeout time.Duration
146146
// ApolloRouterCompatibilitySubrequestHTTPError is a compatibility flag for Apollo Router, it is used to handle HTTP errors in subrequests differently
@@ -154,8 +154,8 @@ func New(ctx context.Context, options ResolverOptions) *Resolver {
154154
options.MaxConcurrency = 32
155155
}
156156

157-
if options.MultipartSubHeartbeatInterval <= 0 {
158-
options.MultipartSubHeartbeatInterval = DefaultHeartbeatInterval
157+
if options.SubHeartbeatInterval <= 0 {
158+
options.SubHeartbeatInterval = DefaultHeartbeatInterval
159159
}
160160

161161
// We transform the allowed fields into a map for faster lookups
@@ -198,7 +198,7 @@ func New(ctx context.Context, options ResolverOptions) *Resolver {
198198
triggerUpdateBuf: bytes.NewBuffer(make([]byte, 0, 1024)),
199199
allowedErrorExtensionFields: allowedExtensionFields,
200200
allowedErrorFields: allowedErrorFields,
201-
heartbeatInterval: options.MultipartSubHeartbeatInterval,
201+
heartbeatInterval: options.SubHeartbeatInterval,
202202
maxSubscriptionFetchTimeout: options.MaxSubscriptionFetchTimeout,
203203
}
204204
resolver.maxConcurrency = make(chan struct{}, options.MaxConcurrency)

v2/pkg/engine/resolve/resolve_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ var multipartSubHeartbeatInterval = 100 * time.Millisecond
9090

9191
func newResolver(ctx context.Context) *Resolver {
9292
return New(ctx, ResolverOptions{
93-
MaxConcurrency: 1024,
94-
Debug: false,
95-
PropagateSubgraphErrors: true,
96-
PropagateSubgraphStatusCodes: true,
97-
AsyncErrorWriter: &TestErrorWriter{},
98-
MultipartSubHeartbeatInterval: multipartSubHeartbeatInterval,
93+
MaxConcurrency: 1024,
94+
Debug: false,
95+
PropagateSubgraphErrors: true,
96+
PropagateSubgraphStatusCodes: true,
97+
AsyncErrorWriter: &TestErrorWriter{},
98+
SubHeartbeatInterval: multipartSubHeartbeatInterval,
9999
})
100100
}
101101

0 commit comments

Comments
 (0)