Closed ARHariri closed 4 years ago
Why would you expect it to not be an Upload
instance? Perhaps you are importing the GraphQLUpload
scalar from a different graphql-upload
version than the processRequest
function is from. You can check by running npm ls graphql-upload
- there should only be one version in your node_modules
.
I use apollo-server-express
that uses graphql-upload
v8.1.0 as a dependency and I installed the latest version (v10.0.0) to define Upload
scalar (apollo-server
handles uploading files (with graphql-upload
) but I should create Upload
scalar manually because I use nexus
to create GraphQL schemas). So there are two versions of graphql-upload
package inevitably.
Closing because the problem is not an issue with graphql-upload
. There are existing issues you can find in the Apollo repos about graphql-upload
being outdated in their dependencies, and the various workarounds available to manually upgrade.
Hi there. I cannot upload a file as I get "Upload value invalid" error, unless I override
parseValue
function. As I see, there is a condition inparseValue
function (in theGraphQLUpload.js
file) that expects to get an instance ofUpload
value
. I think this condition should be changed to something like thisvalue instanceof Blob
to resolve the error (Check thevalue
to be an instance of Blob instead ofUpload
).p.s.: It seems this condition added to resolve this issue.