@graphql-tools/executor-http
Advanced tools
Comparing version 1.1.13-alpha-b1f2cd0ac670dec709b2fe1a50496e079d68604b to 1.1.13-alpha-c1d0bb8165a238ba9dd1fc0cd8cc436f3cb43dac
# @graphql-tools/executor-http | ||
## 1.1.13-alpha-b1f2cd0ac670dec709b2fe1a50496e079d68604b | ||
## 1.1.13-alpha-c1d0bb8165a238ba9dd1fc0cd8cc436f3cb43dac | ||
### Patch Changes | ||
- [#274](https://github.com/graphql-hive/gateway/pull/274) [`2d13b51`](https://github.com/graphql-hive/gateway/commit/2d13b512f2deb7e3640f3948c7c6631caf4f4346) Thanks [@ardatan](https://github.com/ardatan)! - Improve multipart support | ||
- [#274](https://github.com/graphql-hive/gateway/pull/274) [`3f1a0fa`](https://github.com/graphql-hive/gateway/commit/3f1a0fa9f1f3b91542d00a0211d7def8ef30827e) Thanks [@ardatan](https://github.com/ardatan)! - Improve multipart support | ||
@@ -9,0 +9,0 @@ ## 1.1.12 |
@@ -80,34 +80,37 @@ import { isAsyncIterable, isPromise, mapMaybePromise, memoize1, createGraphQLError, inspect, mapAsyncIterator, mergeIncrementalResult, getOperationASTFromRequest } from '@graphql-tools/utils'; | ||
if (upload != null) { | ||
return mapMaybePromise(upload?.promise || upload, (upload2) => { | ||
const filename = upload2.filename || upload2.name || upload2.path || `blob-${indexStr}`; | ||
if (isBlob(upload2)) { | ||
form.append(indexStr, upload2, filename); | ||
} else if (isAsyncIterable(upload2)) { | ||
return mapMaybePromise( | ||
collectAsyncIterableValues(upload2), | ||
(chunks) => { | ||
const blobPart = new Uint8Array(chunks); | ||
form.append( | ||
indexStr, | ||
new FileCtor([blobPart], filename), | ||
filename | ||
); | ||
} | ||
); | ||
} else if (isGraphQLUpload(upload2)) { | ||
return mapMaybePromise( | ||
collectAsyncIterableValues(upload2.createReadStream()), | ||
(chunks) => { | ||
const blobPart = new Uint8Array(chunks); | ||
form.append( | ||
indexStr, | ||
new FileCtor([blobPart], filename, { type: upload2.mimetype }), | ||
filename | ||
); | ||
} | ||
); | ||
} else { | ||
form.append(indexStr, new FileCtor([upload2], filename), filename); | ||
return mapMaybePromise( | ||
upload?.promise || upload, | ||
(upload2) => { | ||
const filename = upload2.filename || upload2.name || upload2.path || `blob-${indexStr}`; | ||
if (isBlob(upload2)) { | ||
form.append(indexStr, upload2, filename); | ||
} else if (isAsyncIterable(upload2)) { | ||
return mapMaybePromise( | ||
collectAsyncIterableValues(upload2), | ||
(chunks) => { | ||
const blobPart = new Uint8Array(chunks); | ||
form.append( | ||
indexStr, | ||
new FileCtor([blobPart], filename), | ||
filename | ||
); | ||
} | ||
); | ||
} else if (isGraphQLUpload(upload2)) { | ||
return mapMaybePromise( | ||
collectAsyncIterableValues(upload2.createReadStream()), | ||
(chunks) => { | ||
const blobPart = new Uint8Array(chunks); | ||
form.append( | ||
indexStr, | ||
new FileCtor([blobPart], filename, { type: upload2.mimetype }), | ||
filename | ||
); | ||
} | ||
); | ||
} else { | ||
form.append(indexStr, new FileCtor([upload2], filename), filename); | ||
} | ||
} | ||
}); | ||
); | ||
} | ||
@@ -114,0 +117,0 @@ } |
{ | ||
"name": "@graphql-tools/executor-http", | ||
"version": "1.1.13-alpha-b1f2cd0ac670dec709b2fe1a50496e079d68604b", | ||
"version": "1.1.13-alpha-c1d0bb8165a238ba9dd1fc0cd8cc436f3cb43dac", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "A set of utils for faster development of GraphQL tools", |
Sorry, the diff of this file is not supported yet
63684
1205