Skip to content

Conversation

@Shane32
Copy link
Member

@Shane32 Shane32 commented Feb 2, 2026

Description

Fixes an issue in SDLPrinter where anonymous query operations with variables were not printing the query keyword.

According to the GraphQL specification, when an operation includes variable definitions, the operation type must be explicitly declared even for query operations without a name.

Changes

Example

Before:

($arg: String){
  field1
}

After:

query ($arg: String){
  field1
}

@Shane32 Shane32 linked an issue Feb 2, 2026 that may be closed by this pull request
@Shane32 Shane32 self-assigned this Feb 2, 2026
@Shane32 Shane32 added the bugfix Pull request that fixes a bug label Feb 2, 2026
@Shane32 Shane32 added this to the 9.5.1 milestone Feb 2, 2026
@Shane32 Shane32 requested a review from gao-artur February 2, 2026 05:12
@gao-artur
Copy link
Contributor

I think you added it to a wrong milestone

@gao-artur
Copy link
Contributor

I think you added it to a wrong milestone

Oh, it's a parser repo. Nevermind.

@Shane32 Shane32 merged commit ad7f802 into master Feb 2, 2026
6 checks passed
@Shane32 Shane32 deleted the printqueryfix branch February 2, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formatter makes invalid GraphQL for unnamed query

3 participants