Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Copy link
Copy Markdown

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 braceless interface Empty stays invalid.

1. An Interface type must define a set of fields. The set may be empty.

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 {"\_\_"}
Expand All @@ -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}.
Expand Down Expand Up @@ -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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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: union Empty would be the only form, and it becomes valid once this rule is removed. Is that fine for unions, or did you have something like union Empty = in mind?

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.

Expand Down
Loading