@@ -15,7 +15,7 @@ const GraphQL = require("graphql");
1515const { PubSub, withFilter } = require ( "graphql-subscriptions" ) ;
1616const hash = require ( "object-hash" ) ;
1717
18- module . exports = function ( mixinOptions ) {
18+ module . exports = function ( mixinOptions ) {
1919 mixinOptions = _ . defaultsDeep ( mixinOptions , {
2020 routeOptions : {
2121 path : "/graphql" ,
@@ -212,6 +212,8 @@ module.exports = function(mixinOptions) {
212212 ? await dataLoader . loadMany ( dataLoaderKey )
213213 : await dataLoader . load ( dataLoaderKey ) ;
214214 } else if ( fileUploadArg != null && args [ fileUploadArg ] != null ) {
215+ const additionalArgs = _ . omit ( args , [ fileUploadArg ] ) ;
216+
215217 if ( Array . isArray ( args [ fileUploadArg ] ) ) {
216218 return await Promise . all (
217219 args [ fileUploadArg ] . map ( async uploadPromise => {
@@ -221,7 +223,7 @@ module.exports = function(mixinOptions) {
221223 } = await uploadPromise ;
222224 const stream = createReadStream ( ) ;
223225 return context . ctx . call ( actionName , stream , {
224- meta : { $fileInfo } ,
226+ meta : { $fileInfo, $args : additionalArgs } ,
225227 } ) ;
226228 } )
227229 ) ;
@@ -230,7 +232,7 @@ module.exports = function(mixinOptions) {
230232 const { createReadStream, ...$fileInfo } = await args [ fileUploadArg ] ;
231233 const stream = createReadStream ( ) ;
232234 return await context . ctx . call ( actionName , stream , {
233- meta : { $fileInfo } ,
235+ meta : { $fileInfo, $args : additionalArgs } ,
234236 } ) ;
235237 } else {
236238 const params = { } ;
0 commit comments