@graphql-tools/url-loader 7.14.3 → 7.15.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/cjs/index.js +3 -4
- package/esm/index.js +3 -4
- package/package.json +1 -1
- package/typings/index.d.cts +1 -2
- package/typings/index.d.ts +1 -2
package/cjs/index.js
CHANGED
|
@@ -191,7 +191,6 @@ class UrlLoader {
|
|
|
191
191
|
}
|
|
192
192
|
}, options.timeout);
|
|
193
193
|
}
|
|
194
|
-
const credentials = (options === null || options === void 0 ? void 0 : options.credentials) !== 'disable' ? (options === null || options === void 0 ? void 0 : options.credentials) || 'same-origin' : null;
|
|
195
194
|
return new value_or_promise_1.ValueOrPromise(() => {
|
|
196
195
|
switch (method) {
|
|
197
196
|
case 'GET':
|
|
@@ -201,7 +200,7 @@ class UrlLoader {
|
|
|
201
200
|
});
|
|
202
201
|
return fetch(finalUrl, {
|
|
203
202
|
method: 'GET',
|
|
204
|
-
...(credentials != null ? { credentials } : {}),
|
|
203
|
+
...((options === null || options === void 0 ? void 0 : options.credentials) != null ? { credentials: options.credentials } : {}),
|
|
205
204
|
headers,
|
|
206
205
|
signal: controller === null || controller === void 0 ? void 0 : controller.signal,
|
|
207
206
|
}, request.context, request.info);
|
|
@@ -210,7 +209,7 @@ class UrlLoader {
|
|
|
210
209
|
return new value_or_promise_1.ValueOrPromise(() => this.createFormDataFromVariables(requestBody))
|
|
211
210
|
.then(body => fetch(endpoint, {
|
|
212
211
|
method: 'POST',
|
|
213
|
-
...(credentials != null ? { credentials } : {}),
|
|
212
|
+
...((options === null || options === void 0 ? void 0 : options.credentials) != null ? { credentials: options.credentials } : {}),
|
|
214
213
|
body,
|
|
215
214
|
headers: {
|
|
216
215
|
...headers,
|
|
@@ -223,7 +222,7 @@ class UrlLoader {
|
|
|
223
222
|
else {
|
|
224
223
|
return fetch(endpoint, {
|
|
225
224
|
method: 'POST',
|
|
226
|
-
...(credentials != null ? { credentials } : {}),
|
|
225
|
+
...((options === null || options === void 0 ? void 0 : options.credentials) != null ? { credentials: options.credentials } : {}),
|
|
227
226
|
body: JSON.stringify(requestBody),
|
|
228
227
|
headers: {
|
|
229
228
|
'content-type': 'application/json',
|
package/esm/index.js
CHANGED
|
@@ -187,7 +187,6 @@ export class UrlLoader {
|
|
|
187
187
|
}
|
|
188
188
|
}, options.timeout);
|
|
189
189
|
}
|
|
190
|
-
const credentials = (options === null || options === void 0 ? void 0 : options.credentials) !== 'disable' ? (options === null || options === void 0 ? void 0 : options.credentials) || 'same-origin' : null;
|
|
191
190
|
return new ValueOrPromise(() => {
|
|
192
191
|
switch (method) {
|
|
193
192
|
case 'GET':
|
|
@@ -197,7 +196,7 @@ export class UrlLoader {
|
|
|
197
196
|
});
|
|
198
197
|
return fetch(finalUrl, {
|
|
199
198
|
method: 'GET',
|
|
200
|
-
...(credentials != null ? { credentials } : {}),
|
|
199
|
+
...((options === null || options === void 0 ? void 0 : options.credentials) != null ? { credentials: options.credentials } : {}),
|
|
201
200
|
headers,
|
|
202
201
|
signal: controller === null || controller === void 0 ? void 0 : controller.signal,
|
|
203
202
|
}, request.context, request.info);
|
|
@@ -206,7 +205,7 @@ export class UrlLoader {
|
|
|
206
205
|
return new ValueOrPromise(() => this.createFormDataFromVariables(requestBody))
|
|
207
206
|
.then(body => fetch(endpoint, {
|
|
208
207
|
method: 'POST',
|
|
209
|
-
...(credentials != null ? { credentials } : {}),
|
|
208
|
+
...((options === null || options === void 0 ? void 0 : options.credentials) != null ? { credentials: options.credentials } : {}),
|
|
210
209
|
body,
|
|
211
210
|
headers: {
|
|
212
211
|
...headers,
|
|
@@ -219,7 +218,7 @@ export class UrlLoader {
|
|
|
219
218
|
else {
|
|
220
219
|
return fetch(endpoint, {
|
|
221
220
|
method: 'POST',
|
|
222
|
-
...(credentials != null ? { credentials } : {}),
|
|
221
|
+
...((options === null || options === void 0 ? void 0 : options.credentials) != null ? { credentials: options.credentials } : {}),
|
|
223
222
|
body: JSON.stringify(requestBody),
|
|
224
223
|
headers: {
|
|
225
224
|
'content-type': 'application/json',
|
package/package.json
CHANGED
package/typings/index.d.cts
CHANGED
|
@@ -89,10 +89,9 @@ export interface LoadFromUrlOptions extends BaseLoaderOptions, Partial<Introspec
|
|
|
89
89
|
timeout?: number;
|
|
90
90
|
/**
|
|
91
91
|
* Request Credentials (default: 'same-origin')
|
|
92
|
-
* You can pass `disable` if you don't want this to be set in `Request`
|
|
93
92
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials
|
|
94
93
|
*/
|
|
95
|
-
credentials?: RequestCredentials
|
|
94
|
+
credentials?: RequestCredentials;
|
|
96
95
|
/**
|
|
97
96
|
* Connection Parameters for WebSockets connection
|
|
98
97
|
*/
|
package/typings/index.d.ts
CHANGED
|
@@ -89,10 +89,9 @@ export interface LoadFromUrlOptions extends BaseLoaderOptions, Partial<Introspec
|
|
|
89
89
|
timeout?: number;
|
|
90
90
|
/**
|
|
91
91
|
* Request Credentials (default: 'same-origin')
|
|
92
|
-
* You can pass `disable` if you don't want this to be set in `Request`
|
|
93
92
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials
|
|
94
93
|
*/
|
|
95
|
-
credentials?: RequestCredentials
|
|
94
|
+
credentials?: RequestCredentials;
|
|
96
95
|
/**
|
|
97
96
|
* Connection Parameters for WebSockets connection
|
|
98
97
|
*/
|