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

Add "Objects must define fields" schema validation #1167

Conversation

maartenvanvliet
Copy link
Contributor

This PR adds an extra schema validation to ensure any object, input_object or interface declares one or more fields. See https://github.com/graphql/graphql-spec/blame/October2021/spec/Section%203%20--%20Type%20System.md#L868 in the spec. Introspection fields are not counted.

It affects a lot of test files since an empty query do, ... end is no longer allowed.

For current users, since this change would be noticed during compilation, the impact is minimal. Some users might encounter invalid schemas.

fixes #1166
fixes #1105 as schema won't compile

Copy link
Contributor

@benwilson512 benwilson512 left a comment

Choose a reason for hiding this comment

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

This looks great thanks!

@benwilson512
Copy link
Contributor

Hey @maartenvanvliet this is getting test failures on the CI now, can you investigate?

@maartenvanvliet maartenvanvliet force-pushed the objects_must_define_fields branch from c31d284 to 035df04 Compare September 8, 2022 10:07
@maartenvanvliet
Copy link
Contributor Author

👍 I pushed some fixes

@benwilson512 benwilson512 merged commit df1808c into absinthe-graphql:master Sep 8, 2022
@benwilson512
Copy link
Contributor

Thanks!

@ryanwinchester
Copy link

I think this should have been [Breaking Bugfix]?

@benwilson512
Copy link
Contributor

Good callout, the CHANGELOG has been updated accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants