Skip to content

fix: fail fast on Node < 22 — root cause of the "grafast ConnectionStep" list/connection failures#1460

Merged
pyramation merged 1 commit into
mainfrom
fix/grafast-list-connection
Jul 26, 2026
Merged

fix: fail fast on Node < 22 — root cause of the "grafast ConnectionStep" list/connection failures#1460
pyramation merged 1 commit into
mainfrom
fix/grafast-list-connection

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Root cause of the list/connection "bug": there is no grafast/plugin bug — the failures only occur when the server runs on Node < 22.

grafast@1.0.2 and @dataplan/pg@1.0.3 declare engines.node >= 22 and call Promise.withResolvers() (Node 22+) inside their query-execution paths (@dataplan/pg/dist/executor.js, grafast/dist/prepare.js). On Node 20 this doesn't fail fast: the PgSelect collection value ends up undefined, and every connection query ({ things { nodes { … } } }) dies inside ConnectionStep.execute with:

TypeError: Cannot read properties of undefined (reading 'items')
    at grafast/src/steps/connection.ts:824

while mutations and single-record lookups keep working — exactly the symptom that caused the e2e assertions to be it.skip'd / rewritten as mutations. Reproduced deterministically: the same suites fail on Node 20.18 and pass on Node 22 against the same database. CI runs Node 22, which is why CI was always green.

Tests: every test skipped for this bug was already re-enabled on main (8e8744d, test(server-test): unskip connection-query integration tests) — no it.skip or mutation workarounds remain (verified by search). Verified locally on Node 22: graphql/server-test 140/140 pass (incl. scoped-routing golden path, server.integration all 5 scenarios, express-context, upload w/ MinIO), graphql/test 20/20, graphile/graphile-test 21/21.

Changes (fail fast + document, no behavior change on supported Node):

  • createConstructivePreset() now throws at preset construction when Promise.withResolvers is missing, naming the real requirement and the misleading symptom — so any schema built from the Constructive preset fails loudly instead of breaking only connection queries at runtime.
  • root engines.node: >=18.17.0>=22; added .nvmrc (22).
  • GRAPHILE.md "Node Version Requirement" section + DEVELOPMENT.md note documenting the symptom → cause mapping.

No upstream grafast issue to report and no version bump needed: grafast@1.1.0's connection.js is byte-identical to 1.0.2's, and @dataplan/pg@1.1.1 has no relevant fix — the pinned versions are correct when run on a supported Node.

Note: pnpm lint is currently broken repo-wide (ESLint 9 installed but only a legacy .eslintrc.json exists; CI does not run lint) — pre-existing and untouched here.

Link to Devin session: https://app.devin.ai/sessions/d7f278d4eb5b4e459e102150e48cfc4f
Requested by: @pyramation

@pyramation pyramation self-assigned this Jul 26, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation
pyramation merged commit b00213b into main Jul 26, 2026
15 checks passed
@pyramation
pyramation deleted the fix/grafast-list-connection branch July 26, 2026 07:08
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