graphql-js
graphql-js copied to clipboard
Implement OneOf Input Objects via `@oneOf` directive
This PR implements graphql/graphql-spec#825 to add a @oneOf directive that indicates ~~an Object is a OneOf Object or~~ an Input Object is a OneOf Input Object. We then validate ~~OneOf Objects and~~ OneOf Input Objects conform to the spec during the validation and execution phases.
Closes graphql/graphql-wg#648
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: erikkessler1 / name: Erik Kessler (99189d9a6baf811ca9e4e4ce691918703e3f308f, 534b243baa5a3b0b101c7dba7741583a447d661a, 25928e3174fc342d02b58ef270b6cc3474fa2b2e, 24f0d9528a0c7d6eccff9dd1a02ed8140ab1e402, 15e39f5b10e450a3913af0a4777b21afa77fd30f, 50bb96844f527498d57f640e433863fcb768872a)
Deploy Preview for compassionate-pike-271cb3 failed.
| Name | Link |
|---|---|
| Latest commit | cfc68cdea06ed73c55ed10ef4a816fa1658e8e1a |
| Latest deploy log | https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/64677c014a3b3100086e8c6d |
As for oneOf input objects, this is all the spec PR addresses currently; would it make sense to cut down this PR to only deal with oneOf input objects to get this closer to review?
Thank you for taking a look! I agree that focusing on oneOf input objects makes sense, so I've stripped out everything around oneOf objects.
Odd, all my comments seem to have been duplicated; I've deleted the duplicates.
I've added some test coverage for those cases including the variables: { a: "abc", b: undefined } case.
Pushed a commit that hopefully deals with the code coverage issue :+1:
Merged main; CI passing now :raised_hands:
Great feedback, thanks @IvanGoncharov!
@graphql/graphql-js-reviewers I believe this is ready for review and possibly merge into v17 👍
Hi 👋, is there any outlook on when this might get merged and published? :)
@graphql/graphql-js-reviewers I've merged in the latest main, so it should be good for review 👍
@IvanGoncharov Can you dismiss your stale review, please?
@IvanGoncharov any chance you can dismiss the review @benjie mentioned above? I know this has been a long awaited feature for many
@IvanGoncharov It looks like the changes requested from your review have been addressed. Just kindly wanted to remind you about this as the review is stale at this point.
@benjie Do you anticipate any further changes expected to be made on this PR? I was just curious about the status of this feature and what else needs to be done.
I'm not aware of any expected changes.
Sorry missed that spec proposal in stage 2, so this PR can actually be merged. Also missed all the comments (my inbox is in bad shape atm). @benjie Thank you for the ping 👍
@erikkessler1 If you don't mind, I will address stylistic changes by just committing on top of your PR. I think it would be faster that way, it takes a lot of time to comment on a lot of tiny changes.
If you don't mind, I will address stylistic changes by just committing on top of your PR. I think it would be faster that way, it takes a lot of time to comment on a lot of tiny changes.
@IvanGoncharov that sounds good to me!
@erikkessler1 Thanks for addressing my review comments, and sorry for the delay 🙇 I'm still planning to review/merge this PR, and I will try to find time this weekend.
@erikkessler1 Sorry, I didn't find time for a quality review. That said, the last time I reviewed it, all issues were non-critical and could be fixed later. Since there were no other objections I will merge it as is.