Skip to content

Conversation

pavelnikolov
Copy link
Member

Make the library compliant with the spects and disallow empty fields in objects, interfaces and input objects.

@pavelnikolov pavelnikolov requested a review from Copilot August 22, 2025 21:15
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements GraphQL specification compliance by enforcing that object types, interface types, and input object types must define at least one field. The change prevents the creation of empty type definitions which violates the GraphQL specification.

  • Adds validation to reject empty object, interface, and input object type definitions
  • Updates existing tests to include required fields in previously empty Query types
  • Adds comprehensive test coverage for the new validation rules

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/schema/schema.go Implements validation logic to reject empty type definitions
schema_empty_types_test.go Adds comprehensive test cases for empty type validation
subscription_test.go Updates test schemas to include required Query fields
internal/schema/schema_test.go Fixes existing tests with empty type definitions
graphql_test.go Adds required Query fields and resolver methods
example_scalar_map_test.go Updates Query type to include required field
example_nullbool_test.go Updates Query type to include required field
CHANGELOG.md Documents the bugfix in changelog

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pavelnikolov pavelnikolov merged commit 5ca91cb into main Aug 22, 2025
3 checks passed
@pavelnikolov
Copy link
Member Author

fixes #441

@pavelnikolov pavelnikolov deleted the disallow-empty-field-lists branch August 22, 2025 22:37
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.

1 participant