Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parseValue expects get an instance of Upload value #197

Closed
ARHariri opened this issue Apr 27, 2020 · 3 comments
Closed

parseValue expects get an instance of Upload value #197

ARHariri opened this issue Apr 27, 2020 · 3 comments

Comments

@ARHariri
Copy link

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 in parseValue function (in the GraphQLUpload.js file) that expects to get an instance of Upload value.
I think this condition should be changed to something like this value instanceof Blob to resolve the error (Check the value to be an instance of Blob instead of Upload).

p.s.: It seems this condition added to resolve this issue.

@jaydenseric
Copy link
Owner

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.

@ARHariri
Copy link
Author

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.

@jaydenseric
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants