Skip to content
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

pse/fixed empty object type #58

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
24 changes: 21 additions & 3 deletions spec/Section 4 -- Composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ run in sequence to produce the composite execution schema.

**Error Code**

`Empty_Merged_Object_Type`
`EMPTY_MERGED_OBJECT_TYPE`

**Severity** ERROR

**Formal Specification**

Expand All @@ -32,8 +34,9 @@ run in sequence to produce the composite execution schema.

IsObjectTypeEmpty(type):

- Let {fields} be a set of all fields of all types with coordinate and kind
{type} across all source schemas
- If {type} has `@inaccessible` directive
- return false
- Let {fields} be a set of all fields in {type}
- For each {field} in {fields}:
- If {IsExposed(field)} is true
- return false
Expand Down Expand Up @@ -63,6 +66,21 @@ type ObjectType1 {
}
```

If the `@inaccessible` directive is applied to an object type itself, the entire
merged object type is excluded from the composite execution schema, and it is
not required to contain any fields.

```graphql
type ObjectType1 @inaccessible {
field1: String
field2: Int
}

type ObjectType1 {
field3: Boolean
}
```

This counter-example demonstrates an invalid merged object type. In this case,
`ObjectType1` is defined in two source schemas, but all fields are marked as
`@inaccessible` in at least one of the source schemas, resulting in an empty
Expand Down
Loading