Comments (8)
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.
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.
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.
@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.
I have this issue with ReactNativeFile only in ios
from graphql-upload.
@EhsanSarshar did you manage to solve it? I'm having the same problem 😓
from graphql-upload.
@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.
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 thename
property in ReactNativeFile construction was undefined. My fix was to patch thename
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
andname
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)
- Unexpected end of form at Multipart._final HOT 4
- NPM package dicer DoS vulnerability HOT 2
- How can I upload file on Next.js HOT 1
- Apollo Server v4 with Lambda HOT 1
- ERROR [ExceptionsHandler] Multipart: Boundary not found - Digital Ocean - AppPlatform HOT 1
- FileUpload - where is fileName, mimetype and createReadStream ? HOT 8
- Error [ERR_REQUIRE_ESM]: require() of ES Module not supported HOT 8
- Hard to find FileUpload interface. HOT 1
- Error: No "exports" main defined in /Volumes/Personal/code-work/node-projects/office/pf-node-backend/node_modules/graphql-upload/package.json HOT 1
- Why misorder of operations and map will cause error thrown? HOT 3
- export graphqlUploadExpress HOT 4
- Invalid object path for the 'map' multipart field entry key '0' array index '0' HOT 1
- in my mutation i have two arguments which have Upload type and both return null HOT 2
- ERR_PACKAGE_PATH_NOT_EXPORTED HOT 1
- Error: Expected undefined to be a GraphQL nullable type.
- Apollo Server v4 issue - BadRequestError: POST body missing, invalid Content-Type, or JSON object has no keys. HOT 2
- Graphql-upload not working for Type-Graphql based project But old version of graphql-upload (.js) version works HOT 1
- Cannot find type definition file for 'fs-capacitor'. HOT 1
- Graphql File Upload NestJS issue HOT 3
- upload multiple images has error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-upload.