-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Conditional uses of arguments #199
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
Comments
Can't say I speak with authority but I think the answer is no. Your other options are to have two fields names EventAt(CoordinateType) & EventBy(CoordinateType) or an additional boolean argument to field Event(c: CoordinateType, isExact: Boolean) Can't say I like either of those options either 😄 |
@IamCornholio Roger that. Your option may be very close to what I need now. Thanks for the advice 😀 |
Cases like this is why some are arguing for union input types: graphql/graphql-js#207 That proposal has some issues, but this is certainly an area where GraphQL could improve. |
Closing this aging issue. Custom code would be necessary to enforce this sort of argument usage. |
Is there any support for conditional uses of arguments, i.e. when you have
at
andby
,but you can only accept an argument one at a time. Or should we write the code ourselves to check if both arguments are available in throw an
GraphQLError
?The text was updated successfully, but these errors were encountered: