-
-
Notifications
You must be signed in to change notification settings - Fork 677
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
Union types for ArgsType? #384
Comments
No, this is not supported by GraphQL spec. Unions are output types and can't be used in args or inputs. |
Hmmm... but how would you accept args/inputs that are an array of different types? Any recommendation? |
input MyInput {
one: OneInput
two: TwoInput
three: ThreeInput
} And in runtime you check which field is filled. |
No my goal is: Array<TypeA, TypeB, TypeC> so the array consists of different types with an unknown amount. one possible way would be: input Input {
string: StringInput[],
date: DateInput[],
time: TimeInpiut[]
} But this would break my structure because i don't have the origin sorting anymore... |
So you have to make an RFC to the GraphQL spec with a proposed change or switch to REST. Sorry 😕 |
Ok i change my structure to this:
Thank you for your help |
Is it possible to use union types for ArgsType() ?
i tried it this way but i receive an "cannot determine graphql input type for tests"
Thank you :-)
The text was updated successfully, but these errors were encountered: