File tree 1 file changed +13
-11
lines changed
packages/relay-experimental
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ function loadQuery<TQuery: OperationType, TEnvironmentProviderOptions>(
169
169
( { dispose : cancelOnLoadCallback } = PreloadableQueryRegistry . onLoad (
170
170
moduleId ,
171
171
preloadedModule => {
172
- clearTimeout ( loadQueryAstTimeoutId ) ;
172
+ loadQueryAstTimeoutId != null && clearTimeout ( loadQueryAstTimeoutId ) ;
173
173
cancelOnLoadCallback ( ) ;
174
174
const operation = createOperationDescriptor (
175
175
preloadedModule ,
@@ -178,16 +178,18 @@ function loadQuery<TQuery: OperationType, TEnvironmentProviderOptions>(
178
178
executeWithSource ( operation , source ) ;
179
179
} ,
180
180
) ) ;
181
- loadQueryAstTimeoutId = setTimeout ( ( ) => {
182
- cancelOnLoadCallback ( ) ;
183
- const onTimeout = options ?. onQueryAstLoadTimeout ;
184
- if ( onTimeout ) {
185
- onTimeout ( ) ;
186
- }
187
- // complete() the subject so that the observer knows no (additional) payloads
188
- // will be delivered
189
- normalizationSubject . complete ( ) ;
190
- } , LOAD_QUERY_AST_MAX_TIMEOUT ) ;
181
+ if ( ! environment . isServer ( ) ) {
182
+ loadQueryAstTimeoutId = setTimeout ( ( ) => {
183
+ cancelOnLoadCallback ( ) ;
184
+ const onTimeout = options ?. onQueryAstLoadTimeout ;
185
+ if ( onTimeout ) {
186
+ onTimeout ( ) ;
187
+ }
188
+ // complete() the subject so that the observer knows no (additional) payloads
189
+ // will be delivered
190
+ normalizationSubject . complete ( ) ;
191
+ } , LOAD_QUERY_AST_MAX_TIMEOUT ) ;
192
+ }
191
193
}
192
194
} else {
193
195
const graphQlTaggedNode : GraphQLTaggedNode = ( preloadableRequest : $FlowFixMe ) ;
You can’t perform that action at this time.
0 commit comments