go-graphql-upload icon indicating copy to clipboard operation
go-graphql-upload copied to clipboard

Multiple file uploads in one mutation not working

Open jrkt opened this issue 5 years ago • 0 comments

I have gotten this to work with a single upload with the mutation defined as:

upload(file: Upload!): Boolean!

But, when I try a mutation to handle multiple uploads, it fails. Here is the mutation I can't get to work:

uploadMultiple(files: [Upload!]!): Boolean!

The error is:

panic: interface conversion: interface {} is []interface {}, not map[string]interface {}

goroutine 99 [running]:
github.com/vendorpay/api/vendor/github.com/smithaitufe/go-graphql-upload.findField(0xadfec0, 0xc000288000, 0xc0000b2f30, 0x2, 0x3, 0x2)
        ...github.com/smithaitufe/go-graphql-upload/middleware.go:180 +0x163
github.com/vendorpay/api/vendor/github.com/smithaitufe/go-graphql-upload.singleTransformation.func1(0xc0004bc090, 0xc000561ee0, 0x11, 0x11e8931, 0x1, 0xc000288000)
        ...github.com/smithaitufe/go-graphql-upload/middleware.go:142 +0x129
created by github.com/vendorpay/api/vendor/github.com/smithaitufe/go-graphql-upload.singleTransformation
        ...github.com/smithaitufe/go-graphql-upload/middleware.go:132 +0x114
exit status 2

This error happens in the middleware and prevents the request from ever getting into the resolver. How can I get multiple uploads to work in one mutation?

jrkt avatar Aug 08 '19 16:08 jrkt