jaydenseric / graphql-upload

Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.
https://npm.im/graphql-upload
MIT License
1.43k stars 132 forks source link

in my mutation i have two arguments which have Upload type and both return null #377

Closed ahmedshahd closed 1 year ago

ahmedshahd commented 1 year ago

type Mutation { createWellnessTip( createWellnessTipInput: CreateWellnessTipInput! attachment: [Upload] image: Upload ): WellnessTip! }

When attempting to upload both an attachment and an image in the same mutation using graphql-upload, the attachment and image fields in the resolver are received as null. This issue doesn't occur when uploading either attachment or image alone.

when i log the attachment and image in resolver i got their value in null image null attachment [ null, null, null, null ]

i am using "graphql-upload": "11.0.0",

Screenshot from 2023-08-16 13-08-56 Screenshot from 2023-08-16 13-09-11 Screenshot from 2023-08-16 13-09-23 Screenshot from 2023-08-16 13-09-40

jaydenseric commented 1 year ago

Sorry, but I don't have availability to help people debug their project code. I can only accept bug reports with minimum reproduction steps for issues that are specific to the graphql-upload middleware malfunctioning on the server. It's not clear that your problem relates to that; maybe your client isn't sending a correct GraphQL multipart request to the server.

jaydenseric commented 1 year ago

You can use Upload scalar in as many places as you like in mutation arguments; you just need to remember to actually set all the right file values in the variables when you submit a mutation.