Repository navigation
Allow interfaces with no fields, unions with no members #1229
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1275,8 +1275,7 @@ Interfaces are never valid inputs. | |
|
|
||
| Interface types have the potential to be invalid if incorrectly defined. | ||
|
|
||
| 1. An Interface type must define one or more fields. | ||
| 2. For each field of an Interface type: | ||
| 1. For each field of an Interface type: | ||
| 1. The field must have a unique name within that Interface type; no two | ||
| fields may share the same name. | ||
| 2. The field must not have a name which begins with the characters {"\_\_"} | ||
|
|
@@ -1290,9 +1289,9 @@ Interface types have the potential to be invalid if incorrectly defined. | |
| arguments may share the same name. | ||
| 3. The argument must accept a type where {IsInputType(argumentType)} | ||
| returns {true}. | ||
| 3. An interface type may declare that it implements one or more unique | ||
| 2. An interface type may declare that it implements one or more unique | ||
| interfaces, but may not implement itself. | ||
| 4. An interface type must be a super-set of all interfaces it implements: | ||
| 3. An interface type must be a super-set of all interfaces it implements: | ||
| 1. Let this interface type be {implementingType}. | ||
| 2. For each interface declared implemented as {implementedType}, | ||
| {IsValidImplementation(implementingType, implementedType)} must be {true}. | ||
|
|
@@ -1450,8 +1449,7 @@ Unions are never valid inputs. | |
|
|
||
| Union types have the potential to be invalid if incorrectly defined. | ||
|
|
||
| 1. A Union type must include one or more unique member types. | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not lose the fact they are unique - ensure that it's declared as a "set" somewhere maybe? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder how the direction suggested in #1249 (comment) applies here. Unions have no braces, so there is no way to tell an empty union from an incomplete one: |
||
| 2. The member types of a Union type must all be Object base types; Scalar, | ||
| 1. The member types of a Union type must all be Object base types; Scalar, | ||
| Interface and Union types must not be member types of a Union. Similarly, | ||
| wrapping types must not be member types of a Union. | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as my note on #1228: replace the rule rather than delete it, so
interface Empty {}is valid and a bracelessinterface Emptystays invalid.