[RFC] Limit uniqueness to @skip, @include and @deprecated directives#471
[RFC] Limit uniqueness to @skip, @include and @deprecated directives#471OlegIlyenko wants to merge 2 commits intographql:masterfrom
@skip, @include and @deprecated directives#471Conversation
|
@OlegIlyenko I will try to do detail review in the next couple of days. But from top of my head, it also should include |
@skip and @include directives@skip, @include and @deprecated directives
|
@IvanGoncharov thanks! Good point, I focused on |
|
Partly alternative proposal based on #429 (comment): I think we can define the behavior of multiple
into this:
This also require to change this algorithm: Benefits: Currently you can model only OR for includes: {
field @include(if: $foo)
field @include(if: $bar)
}These proposal allows to do the opossite operation: {
field @include(if: $foo) @include(if: $bar)
} |
|
I like this suggestion. This lifts the constraint and defines intuitive disambiguation rules. I still struggle with the question of why such a strong line is drawn between:
both variations are semantically identical (and raise the same ambiguity issues). In my opinion, if we keep that validation around, then it probably should be reason other than ambiguity between Maybe I should prepare the third PR that is a combination of #472 + non-unique |
|
To follow up from the WG meeting: I think we should extract the skip/include rules from the deprecated to ensure we're leading to the right solution for each. I'm excited about the direction of clearing up ambiguity when using skip and include together |
This proposal directly relates to a discussion in #429. As was discussed at the latest WG meeting, I'm creating several alternative proposals. This one implements proposed solution
3. Limit the validation to only @skip and @include directives.It limits the scope of "Directives Are Unique Per Location" to
@skipand@includedirectives only.This proposal is mutually exclusive with other alternative proposals:
@skip,@includeand@deprecateddirectives ([RFC] Limit uniqueness to@skip,@includeand@deprecateddirectives #471, this one)@leebyron @IvanGoncharov @jjergus I would appreciate your reviews.
Closes #429