Fix GraphQL file upload (#5944)
This commit is contained in:
committed by
Diamond Lewis
parent
73b428bfac
commit
fddd9c26b2
@@ -27,11 +27,11 @@ const load = parseGraphQLSchema => {
|
||||
if (createReadStream) {
|
||||
const stream = createReadStream();
|
||||
data = await new Promise((resolve, reject) => {
|
||||
let data = '';
|
||||
const chunks = [];
|
||||
stream
|
||||
.on('error', reject)
|
||||
.on('data', chunk => (data += chunk))
|
||||
.on('end', () => resolve(data));
|
||||
.on('data', chunk => chunks.push(chunk))
|
||||
.on('end', () => resolve(Buffer.concat(chunks)));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user