Skip to content

Conversation

@01-binary
Copy link
Owner

Summary

This PR fixes the type definition for callout blocks by removing them from BlockObjectRequestWithoutChildren, as callout blocks can actually have children.

Fixes makenotion#575

Problem

The callout block type was incorrectly included in both:

  • BlockObjectRequestWithoutChildren (without children support)
  • BlockObjectRequest (with children support)

This duplicate definition caused TypeScript to incorrectly prevent developers from adding children to callout blocks, even though the Notion UI and API both support nested content within callouts.

Solution

Removed the callout block definition from BlockObjectRequestWithoutChildren (lines 6594-6602 in src/api-endpoints.ts). The correct definition with children support remains in BlockObjectRequest.

Before

// Callout couldn't have children in TypeScript
const callout = {
  type: "callout",
  callout: {
    rich_text: [{ text: { content: "Note" } }],
    children: [...] // ❌ TypeScript error!
  }
}

After

// Callout can now have children
const callout = {
  type: "callout",
  callout: {
    rich_text: [{ text: { content: "Note" } }],
    children: [...] // ✅ Works correctly!
  }
}

Testing

  • ✅ All existing tests pass
  • ✅ TypeScript compilation successful
  • ✅ Linting passes

Notes

This change only affects TypeScript type definitions. No runtime behavior is changed. The Notion API already supports children in callout blocks; this PR simply corrects the SDK's type definitions to match the actual API behavior.

The callout block type was incorrectly included in both BlockObjectRequestWithoutChildren
(without children support) and BlockObjectRequest (with children support). This duplicate
definition prevented developers from adding children to callout blocks in TypeScript, even
though the Notion UI and API both support nested content within callouts.

This commit removes the callout block definition from BlockObjectRequestWithoutChildren,
keeping only the correct definition with children support in BlockObjectRequest.

Fixes makenotion#575
@01-binary 01-binary closed this Sep 8, 2025
@01-binary 01-binary reopened this Sep 8, 2025
@01-binary 01-binary merged commit 16302be into main Sep 8, 2025
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.

"callout" blocks should have children

2 participants