@graphql-tools/url-loader 7.8.0-alpha-8b59ce96.0 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +9 -1
- package/index.mjs +9 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -510,7 +510,15 @@ class UrlLoader {
|
|
|
510
510
|
else if (contentType === null || contentType === void 0 ? void 0 : contentType.includes('multipart/mixed')) {
|
|
511
511
|
return handleMultipartMixedResponse(fetchResult).then(resultStream => addCancelToResponseStream(resultStream, controller));
|
|
512
512
|
}
|
|
513
|
-
return fetchResult.
|
|
513
|
+
return fetchResult.text();
|
|
514
|
+
})
|
|
515
|
+
.then(result => {
|
|
516
|
+
if (typeof result === 'string') {
|
|
517
|
+
return JSON.parse(result);
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
return result;
|
|
521
|
+
}
|
|
514
522
|
})
|
|
515
523
|
.resolve();
|
|
516
524
|
};
|
package/index.mjs
CHANGED
|
@@ -486,7 +486,15 @@ class UrlLoader {
|
|
|
486
486
|
else if (contentType === null || contentType === void 0 ? void 0 : contentType.includes('multipart/mixed')) {
|
|
487
487
|
return handleMultipartMixedResponse(fetchResult).then(resultStream => addCancelToResponseStream(resultStream, controller));
|
|
488
488
|
}
|
|
489
|
-
return fetchResult.
|
|
489
|
+
return fetchResult.text();
|
|
490
|
+
})
|
|
491
|
+
.then(result => {
|
|
492
|
+
if (typeof result === 'string') {
|
|
493
|
+
return JSON.parse(result);
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
return result;
|
|
497
|
+
}
|
|
490
498
|
})
|
|
491
499
|
.resolve();
|
|
492
500
|
};
|