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

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

Closed
ahmedshahd opened this issue Aug 16, 2023 · 2 comments

Comments

@ahmedshahd
Copy link

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
Copy link
Owner

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 jaydenseric closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2023
@jaydenseric
Copy link
Owner

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.

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