Skip to content

Commit

Permalink
Cleanup rule
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalSenn committed Nov 7, 2024
1 parent 0660509 commit f2fb3a9
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions spec/Section 4 -- Composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,21 @@ run in sequence to produce the composite execution schema.

OUTPUT_FIELD_TYPES_NOT_MERGEABLE

**Serverity**

ERROR

**Formal Specification**

- Let {fieldsByName} be a map of field lists where the key is the name of a field and the value is a list of fields from mergeable types from different source schemas with the same name.
- For each {fields} in {fieldsByName}
- {FieldsAreMergeable(fields)} must be true.
- Let {typeNames} be the set of all output type names from all source schemas.
- For each {typeName} in {typeNames}
- Let {types} be the set of all types with the name {typeName} from all source
schemas.
- Let {fieldNames} be the set of all field names from all {types}.
- For each {fieldName} in {fieldNames}
- Let {fields} be the set of all fields with the name {fieldName} from all
{types}.
- {FieldsAreMergeable(fields)} must be true.

FieldsAreMergeable(fields):

Expand All @@ -35,7 +45,8 @@ FieldsAreMergeable(fields):

**Explanatory Text**

Fields on mergeable objects or interfaces that have the same name are considered semantically equivalent and mergeable when they have a mergeable field type.
Fields on objects or interfaces that have the same name are considered
semantically equivalent and mergeable when they have a mergeable field type.

Fields with the same type are mergeable.

Expand All @@ -49,7 +60,8 @@ type User {
}
```

Fields with different nullability are mergeable, resulting in a merged field with a nullable type.
Fields with different nullability are mergeable, resulting in a merged field
with a nullable type.

```graphql example
type User {
Expand Down

0 comments on commit f2fb3a9

Please sign in to comment.