Skip to content

Disallow descriptions on root operation mappings#4393

Merged
andimarek merged 1 commit into
masterfrom
cleanup-root-operation-descriptions
May 20, 2026
Merged

Disallow descriptions on root operation mappings#4393
andimarek merged 1 commit into
masterfrom
cleanup-root-operation-descriptions

Conversation

@andimarek
Copy link
Copy Markdown
Member

Summary

Removes the stale SDL grammar allowance for descriptions directly before schema root operation type mappings, e.g. inside schema { "desc" query: Query }.

This aligns GraphQL Java with the GraphQL spec and graphql-js: schema definitions can have descriptions, but RootOperationTypeDefinition / OperationTypeDefinition itself does not.

Background

The description? on operationTypeDefinition was introduced by PR #706 while adding block strings and SDL descriptions from issue #685. It appears to have been a broad grammar change rather than intentional support for root operation mapping descriptions: the parser never preserved this description on OperationTypeDefinition, and the AST printer/schema generator do not expose it.

Tests

  • ./gradlew test --tests graphql.parser.SDLParserTest

@andimarek andimarek enabled auto-merge (squash) May 20, 2026 08:43
@andimarek andimarek merged commit c8861b0 into master May 20, 2026
11 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 11 5858 (+3 🟢) 5802 (+3 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 17 5858 (+3 🟢) 5801 (+3 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 21 5858 (+3 🟢) 5801 (+3 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 25 5858 (+3 🟢) 5801 (+3 🟢) 0 (±0) 0 (±0) 57 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 23464 (+12 🟢) 23237 (+12 🟢) 0 (±0) 0 (±0) 227 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 29635 3130 90.4% ±0.0%
Branches 8706 1532 85.0% ±0.0%
Methods 7912 1210 86.7% ±0.0%

No per-class coverage changes detected.

Full HTML report: build artifact jacoco-html-report

Updated: 2026-05-20 08:50:57 UTC

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