SIGN IN SIGN UP
payloadcms / payload UNCLAIMED

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.

0 0 16 TypeScript

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

### 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
P
Patrik committed
c2baef44125447534f6e7f55faf09fdd8113f19a
Parent: 8422668
Committed by GitHub <noreply@github.com> on 2/3/2026, 3:07:16 PM