-
Notifications
You must be signed in to change notification settings - Fork 423
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
Support of the @OneOf
Input Object feature
#1062
Comments
@lucarin91 need to think about this. I'm quite unsure about the RFC itself. It looks like copy-paster attempt from Protobuf, but "why the hell" when we have unions in GraphQL? Seems like input unions consisting of input objects (optionally, scalars too) is the thing fitting more naturally into GraphQL. |
Yeah, I agree it isn't the cleaner solution, but for my limited understanding, they came up with that after the better solution, i.e., the tagged types, was not accepted. The tagged types were a general way to have unions on inputs and outputs, but I think there was concern on the implementation side because it will greatly change the language. I am interested in this feature in order to have an input object that will be parsed as a rust enum with struct variants. I managed to implement that as a plain GraphQL object but I will not be able to have validation. So the user could provide every variant at once. Do you think it will be a complex feature to add the support of this |
@ilslv the goal is quite similar, but the solution is not the same. This one proposes extension of GraphQL (as language) trying to emulate |
Looks like
Exposing
To be fair, I'm not sure whether those 2 arguments are enough to expose |
Is there any plan for implementing the RFC: OneOf Input Objects? It is not a final draft but it is getting a lot of attention and other GraphQL libraries already started to implement that.
I am also willing to contribute to the feature if you think it will be useful.
The text was updated successfully, but these errors were encountered: