Asad Ali
Asad Ali

Reputation: 21

How to Define an Input Union Type for File Uploads or Direct URLs in GraphQL Schema and Check Input Type in Resolver Mutation?

I'm working on a GraphQL schema where I need to allow users to upload files or provide direct URLs as input for an image field in a mutation. However, I'm facing difficulty defining an input type that can handle both file uploads and direct URLs, as well as checking the input type in the resolver mutation.

What Did I Try:

What Were I Expecting:

I expected to define an input union type that accepts either file uploads or direct URLs, and then be able to determine the type of input (file upload or direct URL) in the resolver mutation, allowing me to process the input accordingly.

Upvotes: 0

Views: 52

Answers (0)

Related Questions