Skip to content

[codex] Normalize generated load query variables#627

Merged
zth merged 1 commit into
masterfrom
codex-normalize-load-query-variables
May 20, 2026
Merged

[codex] Normalize generated load query variables#627
zth merged 1 commit into
masterfrom
codex-normalize-load-query-variables

Conversation

@zth
Copy link
Copy Markdown
Owner

@zth zth commented May 20, 2026

Summary

  • Normalize variables inside the public RescriptRelayReact.loadQuery wrapper so generated *.load helpers pass {} instead of undefined for no-variable operations.
  • Add provided-variable coverage for no-variable query paths, including generated raw load, useLoader, fetch, fetchPromised, and retain.
  • Add no-variable provided-variable coverage for useMutation and subscriptions.

Root Cause

Generated query load helpers call RescriptRelayReact.loadQuery directly with variables->Internal.convertVariables. For operations whose user variables type is unit, that conversion can produce undefined; Relay then crashes while resolving provided variables from that value.

Validation

  • yarn build:test
  • yarn build
  • yarn test --runTestsByPath __tests__/Test_providedVariables-tests.js __tests__/Test_mutation-tests.js __tests__/Test_subscription-tests.js --runInBand
  • yarn test:ci

@zth zth marked this pull request as ready for review May 20, 2026 19:42
@zth
Copy link
Copy Markdown
Owner Author

zth commented May 20, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@zth zth merged commit 9750294 into master May 20, 2026
5 of 6 checks passed
@zth zth deleted the codex-normalize-load-query-variables branch May 20, 2026 19:47
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