You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current validation rules for directive collisions in schema composition, specifically EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE and OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE, appear to be both inconsistent and incomplete.
Current Behavior
Rules and Algorithms
OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE
- Let {schemas} be the set of all source schemas to be composed.
- For each {schema} in {schemas}:
- Let {types} be the set of all composite types in {schema}.
- For each {type} in {types}:
- Let {fields} be the set of fields on {type}.
- For each {field} in {fields}:
- If {field} is annotated with `@override`:
- {field} must **not** be annotated with `@external`
EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE
- Let {schemas} be the set of all source schemas to be composed.
- For each {schema} in {schemas}:
- Let {types} be the set of all composite types in {schema}.
- For each {type} in {types}:
- Let {fields} be the set of fields on {type}.
- For each {field} in {fields}:
- If {field} is annotated with `@external`:
- For each {argument} in {field}:
- {argument} must **not** be annotated with `@require`
- {field} must **not** be annotated with `@provides`
Issues with the Current Rules
Inconsistent Scope:
OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE focuses specifically on @override and @external collisions, while EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE handles @external with @require and @provides.
Why does @override have its own rule, while other directive collisions are grouped under EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE?
Ambiguity:
It’s unclear which directives fall under the scope of each rule. This makes understanding and maintaining these rules challenging.
Proposal
Introduce a separate rule for each combination of directives. Examples:
EXTERNAL_OVERRIDE_COLLISION:
EXTERNAL_PROVIDES_COLLISION:
EXTERNAL_REQUIRE_COLLISION:
The text was updated successfully, but these errors were encountered:
The current validation rules for directive collisions in schema composition, specifically
EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE
andOVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE
, appear to be both inconsistent and incomplete.Current Behavior
Rules and Algorithms
OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE
EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE
Issues with the Current Rules
Inconsistent Scope:
OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE
focuses specifically on@override
and@external
collisions, whileEXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE
handles@external
with@require
and@provides
.@override
have its own rule, while other directive collisions are grouped underEXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE
?Ambiguity:
Proposal
Introduce a separate rule for each combination of directives. Examples:
EXTERNAL_OVERRIDE_COLLISION
:EXTERNAL_PROVIDES_COLLISION
:EXTERNAL_REQUIRE_COLLISION
:The text was updated successfully, but these errors were encountered: