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

Implement missing schema validation - types must have one or more (fields, enum values, members, input values) #847

Merged

Conversation

tinnou
Copy link
Contributor

@tinnou tinnou commented Mar 26, 2024

Description

Per the GraphQL spec, object, interface, enum, union, and input types must define one or more fields, enum values, members, input values respectively across all extensions.

This PR implements the necessary validation for each of the aforementioned types.

As an example, previously, the following SDL would incorrectly pass schema validation:

directive @foo on OBJECT
type Query {
  foo: User
}
type User 
extend type User @foo

User does not define any fields, even across its extensions.

Copy link
Member

@goto-bus-stop goto-bus-stop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@goto-bus-stop goto-bus-stop merged commit caf820d into apollographql:main Apr 8, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants