Skip to content

fix: SELECT.one also returns undefined - #514

Merged
daogrady merged 6 commits into
mainfrom
johannes-vogel-patch-1
Aug 10, 2026
Merged

fix: SELECT.one also returns undefined#514
daogrady merged 6 commits into
mainfrom
johannes-vogel-patch-1

Conversation

@johannes-vogel

@johannes-vogel johannes-vogel commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Fix: SELECT.one Return Type Now Includes undefined

Bug Fix

🐛 Corrected the return type of SELECT.one overloads to accurately reflect that the result can also be undefined (in addition to null), matching the actual runtime behavior.

Changes

  • apis/ql.d.ts: Updated multiple SELECT_one overload signatures to change the awaited return type from T | null to T | null | undefined. This affects the following overloads:
    • (entityType: T, projection?) — with ArrayConstructable
    • (entityType: T, primaryKey, projection?) — with ArrayConstructable
    • (entity: T[], projection?)
    • (entity: T[], primaryKey, projection?)
    • (entity: { new(): T }, projection?)
    • (entity: { new(): T }, primaryKey, projection?)
  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.28.2

  • LLM: anthropic--claude-4.6-sonnet
  • Output Template: Default Template
  • File Content Strategy: Full file content
  • Event Trigger: pull_request.ready_for_review
  • Summary Prompt: Default Prompt
  • Correlation ID: 00ad88e0-851b-11f1-8335-bd0f27a90554

Comment thread apis/ql.d.ts
@johannes-vogel
johannes-vogel marked this pull request as ready for review July 21, 2026 15:44

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line 179 is not in the diff (it was not changed), so a review comment cannot be posted on it directly. The inconsistency is still worth mentioning in the summary.

The PR adds | undefined to all SELECT_one return types. The existing discussion thread on line 155 is already actively debating the core trade-off (whether null should be kept or replaced entirely, and whether matching plugin behaviour justifies the union). The one additional technical observation — that the primary-key overload in SELECT_from (line 179) still returns only T | null without undefined, creating an asymmetry with the newly widened SELECT_one overloads — cannot be posted as a diff comment because that line is unchanged. This asymmetry should be addressed in the ongoing discussion or in a follow-up.

Summary: The change is minimal and targeted, but the existing review thread highlights an unresolved design question (keep both null and undefined, or consolidate to one) that should be settled before merging. Additionally, consider whether the analogous primary-key overload in SELECT_from needs the same | undefined treatment for a consistent API contract.

PR Bot Information

Version: 1.28.2

  • File Content Strategy: Full file content
  • Event Trigger: pull_request.ready_for_review
  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: 00ad88e0-851b-11f1-8335-bd0f27a90554

@daogrady
daogrady self-requested a review July 22, 2026 06:10

@daogrady daogrady left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! :)

@daogrady
daogrady enabled auto-merge (squash) August 10, 2026 07:55
@daogrady
daogrady merged commit 6c702df into main Aug 10, 2026
11 of 12 checks passed
@daogrady
daogrady deleted the johannes-vogel-patch-1 branch August 10, 2026 07:56
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.

2 participants