Reputation: 21
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.
union ImageInput = Upload | String
.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