Repository navigation
Conversation
print() dropped `query` from an anonymous query. After a type, interface, input, enum, or schema definition that omitted its brace body, parsing the printed document treated that selection set as the previous definition's body.
|
@nimbly1 is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel. A member of the Team first needs to authorize it. |
|
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4901.
printdropsqueryfrom an anonymous query that has no name, variables, or directives, leaving the short form{ ... }. When the previous definition omitted a brace body, the parser reads that{as the previous definition's body. Printing and parsing again either swallows the operation or produces a syntax error.This happens after an object, interface, input, or enum definition or extension with no fields or values, and after a schema definition or extension with no operation types. The printer now keeps the
querykeyword in that case. A query that is first, or that follows a definition which already printed its body, still uses the short form.Verification:
npm run node:test -- src/**/__tests__/**/*-test.tspassed 3112 tests. With coverage limited tosrc/language/printer.ts, lines, branches, and functions were all 100%.npx eslint --max-warnings 0andnpx prettier --checkpassed on the two changed files.npx tsc --noEmitpassed.npx cspellpassed on the two changed files.npm testwas not run as one command. That script also runs the Deno publish dry-run and the integration tests.