Giter VIP home page Giter VIP logo

Comments (8)

Dajust avatar Dajust commented on May 22, 2024 2

I had this problem in React Native (Android). The problem for my case happened when Android couldn't get the filename of the photo, so the name property in ReactNativeFile construction was undefined. My fix was to patch the name property like so:

  {
        uri: image.path,
        type: image.mime,
        name: image.filename || `${Date.now()}.${image.mime.split('/')[1]}`,
   }

Although the typing of ReactNativefile suggest that both the type and name property could be undefined, graphql-upload obviously doesn't like that.

from graphql-upload.

jaydenseric avatar jaydenseric commented on May 22, 2024

Could you please provide example for how to reproduce that error?

Here is an answer for someone else asking a somewhat related question.

from graphql-upload.

jaydenseric avatar jaydenseric commented on May 22, 2024

FileMissingUploadError should only happen if the multipart request is malformed and does not match the spec. Something unlikely to happen if apollo-upload-client is forming the request.

If you meant the question in the basic GraphQL sense, you can make an Upload scalar optional by not putting a ! next to it.

from graphql-upload.

luciomr avatar luciomr commented on May 22, 2024

@jaydenseric the referenced answer did it for me. My Upload parameter was made optional by not adding the ! next to it, but I was still getting the error because in Postman I was still indicating in my multipart request that there was a file to be expected in the map line.
Leaving the value of map as an empty array ({"0": []}) and giving a value of null to the file parameter in the operations part of the form request fixed it for me.

from graphql-upload.

ehxxn avatar ehxxn commented on May 22, 2024

I have this issue with ReactNativeFile only in ios

from graphql-upload.

amosbastian avatar amosbastian commented on May 22, 2024

@EhsanSarshar did you manage to solve it? I'm having the same problem 😓

from graphql-upload.

ehxxn avatar ehxxn commented on May 22, 2024

@amosbastian I think for me it was a bug in one version on react native. so after releasing a patch I just upgrade and the error gone.

from graphql-upload.

Yemisrach15 avatar Yemisrach15 commented on May 22, 2024

I had this problem in React Native (Android). The problem for my case happened when Android couldn't get the filename of the photo, so the name property in ReactNativeFile construction was undefined. My fix was to patch the name property like so:

  {
        uri: image.path,
        type: image.mime,
        name: image.filename || `${Date.now()}.${image.mime.split('/')[1]}`,
   }

Although the typing of ReactNativefile suggest that both the type and name property could be undefined, graphql-upload obviously doesn't like that.

Thank you for this reallly. I was close to giving up

from graphql-upload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.