Skip to content

docs(graphql): fix invalid pagination queries and unclosed code block - #2372

Open
guillaumedelre wants to merge 1 commit into
api-platform:mainfrom
guillaumedelre:docs/fix-graphql-invalid-snippets
Open

guillaumedelre wants to merge 1 commit into
api-platform:mainfrom
guillaumedelre:docs/fix-graphql-invalid-snippets

Conversation

@guillaumedelre

Copy link
Copy Markdown

Problem

The Prettier check fails on every pull request since Prettier 3.10.0 was released (the CI uses an unpinned npx prettier), always on core/graphql.md.

Two pagination examples in that file use an empty selection set (offers(...) { }), which is invalid GraphQL (graphql-js: Syntax Error: Expected Name, found "}"). Prettier up to 3.9.x could not parse them and left them untouched; Prettier 3.10 accepts them and rewrites them to offers(...) {}, so the check reports the file as unformatted.

Changes

  • Complete both pagination queries with pageInfo and edges fields, consistent with the main example of the section.
  • Close the PHP code block in the "Normalization of MediaObjects" section: it was opened with four backticks and never closed, so the following headings ("Using the createMediaObject Mutation", "Modifying allowed formats with Symfony") were rendered as code.

Verification

  • prettier --check "**/*.md" passes with both 3.9.10 and 3.10.1.
  • markdownlint-cli2 reports no error on core/graphql.md.
  • All 21 GraphQL blocks of core/graphql.md now parse with graphql-js 16.9.0 (19/21 before).

Note: the unclosed PHP code block also exists on the 4.3 and 4.4 branches.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RvXf9WASLamiBZ95f7koty

Empty selection sets are invalid GraphQL and are reformatted by
Prettier 3.10, which breaks the formatting check on every pull request.

This branch has not been deployed

No deployments
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