cjoudrey / graphql-schema-linter

Validate GraphQL schema definitions against a set of rules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Empty union regarded as invalid schema.

leehambley opened this issue · comments

The GraphQL spec's grammar permits empty unions, but a point follows which says that an empty union is invalid. The Apollo Federation spec requires the definition of a union _Entity (no members).

It's not clear to me whether the graphql-schema-linter should forbid this at parse time, or whether it should be a rule we can disable separately.

There's a similar issue here #151

The Federated Schema spec from Apollo actually clarifies that this empty union can be omitted if no types are really federated:

image