You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'`fetch` is not available. Please pass in `fetch` as an option or have it globally available.'
60
59
)
61
-
returnconfigFetch||fetch
60
+
let fetchFunction: typeoffetch
61
+
if(fetcher){
62
+
fetchFunction=fetcher
63
+
}else{
64
+
// `fetcher` is set here rather than the destructuring to ensure fetch is
65
+
// declared before referencing it otherwise it would cause a `ReferenceError`.
66
+
// For reference of this pattern: https://github.com/apollographql/apollo-link/blob/498b413a5b5199b0758ce898b3bb55451f57a2fa/packages/apollo-link-http/src/httpLink.ts#L49
@@ -76,14 +77,15 @@ export default function createHttpMiddleware({
76
77
thrownewError(
77
78
'`AbortController` is not available. Please pass in `AbortController` as an option or have it globally available when using timeout.'
78
79
)
79
-
80
-
if(!fetcher)
80
+
let fetchFunction: typeoffetch
81
+
if(fetcher){
82
+
fetchFunction=fetcher
83
+
}else{
81
84
// `fetcher` is set here rather than the destructuring to ensure fetch is
82
85
// declared before referencing it otherwise it would cause a `ReferenceError`.
83
86
// For reference of this pattern: https://github.com/apollographql/apollo-link/blob/498b413a5b5199b0758ce898b3bb55451f57a2fa/packages/apollo-link-http/src/httpLink.ts#L49
84
-
85
-
// eslint-disable-next-line
86
-
fetcher=fetch
87
+
fetchFunction=fetch
88
+
}
87
89
88
90
letabortController
89
91
if(timeout||_abortController)
@@ -100,21 +102,28 @@ export default function createHttpMiddleware({
100
102
? request.body
101
103
: // NOTE: `stringify` of `null` gives the String('null')
0 commit comments