graphql-js icon indicating copy to clipboard operation
graphql-js copied to clipboard

Implement OneOf Input Objects via `@oneOf` directive

Open erikkessler1 opened this issue 3 years ago • 9 comments

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

erikkessler1 avatar Mar 18 '22 14:03 erikkessler1

CLA Signed

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

netlify[bot] avatar Mar 18 '22 14:03 netlify[bot]

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.

erikkessler1 avatar Apr 02 '22 13:04 erikkessler1

Odd, all my comments seem to have been duplicated; I've deleted the duplicates.

benjie avatar Apr 04 '22 11:04 benjie

I've added some test coverage for those cases including the variables: { a: "abc", b: undefined } case.

erikkessler1 avatar Apr 08 '22 15:04 erikkessler1

Pushed a commit that hopefully deals with the code coverage issue :+1:

benjie avatar May 23 '22 13:05 benjie

Merged main; CI passing now :raised_hands:

benjie avatar May 23 '22 14:05 benjie

Great feedback, thanks @IvanGoncharov!

benjie avatar May 25 '22 09:05 benjie

@graphql/graphql-js-reviewers I believe this is ready for review and possibly merge into v17 👍

benjie avatar May 25 '22 18:05 benjie

Hi 👋, is there any outlook on when this might get merged and published? :)

seamusml avatar Jan 10 '23 09:01 seamusml

@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?

benjie avatar Feb 22 '23 08:02 benjie

@IvanGoncharov any chance you can dismiss the review @benjie mentioned above? I know this has been a long awaited feature for many

saltman424 avatar Apr 21 '23 16:04 saltman424

@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.

yalshekerchi avatar May 11 '23 14:05 yalshekerchi

I'm not aware of any expected changes.

benjie avatar May 11 '23 17:05 benjie

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.

IvanGoncharov avatar May 18 '23 15:05 IvanGoncharov

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 avatar May 18 '23 16:05 erikkessler1

@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.

IvanGoncharov avatar May 31 '23 15:05 IvanGoncharov

@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.

IvanGoncharov avatar Jun 27 '23 11:06 IvanGoncharov