Skip to content

fix(graphql): blocks return null with select: true#15464

Merged
PatrikKozak merged 5 commits intomainfrom
fix/graphql-blocks-select-null
Feb 3, 2026
Merged

fix(graphql): blocks return null with select: true#15464
PatrikKozak merged 5 commits intomainfrom
fix/graphql-blocks-select-null

Conversation

@PatrikKozak
Copy link
Contributor

What

GraphQL queries with select: true were returning null for block fields and throwing "Cannot return null for non-nullable field" errors.

Why

The selection builder wasn't nesting block field selections under their block slug when processing inline fragments. It was creating { contentField: { text: true } } instead of { contentField: { content: { text: true } } }, so the database projection couldn't find the fields.

How

  • Added blockSlug to GraphQL block type extensions so we can identify block types
  • Updated inline fragment handling to nest selections under the block slug for union types

Fixes #15460

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@PatrikKozak PatrikKozak merged commit c2baef4 into main Feb 3, 2026
149 checks passed
@PatrikKozak PatrikKozak deleted the fix/graphql-blocks-select-null branch February 3, 2026 15:07
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🚀 This is included in version v3.75.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GraphQL select: true Breaks Block Fields

2 participants