Skip to content

fix: add graphql-query dep to SDK packages + break cyclic workspace dependency#1029

Merged
pyramation merged 2 commits intomainfrom
devin/1777255014-fix-runtime-dep
Apr 27, 2026
Merged

fix: add graphql-query dep to SDK packages + break cyclic workspace dependency#1029
pyramation merged 2 commits intomainfrom
devin/1777255014-fix-runtime-dep

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

@pyramation pyramation commented Apr 27, 2026

Summary

Two fixes for CI build failures:

1. Missing SDK dependency (from PR #1023)

Fixes the TS2307: Cannot find module '@constructive-io/graphql-query/runtime' build errors introduced by PR #1023.

PR #1023 changed the codegen templates to import from @constructive-io/graphql-query/runtime (consolidating @constructive-io/graphql-types and @0no-co/graphql.web behind a single runtime module), but didn't add @constructive-io/graphql-query as a dependency to the SDK packages that consume the generated code. When the SDK code is regenerated, the new import paths can't resolve.

Changes:

  1. Added "@constructive-io/graphql-query": "workspace:^" to package.json for all 4 affected SDK packages:
    • sdk/constructive-cli
    • sdk/constructive-sdk
    • sdk/constructive-react
    • sdk/migrate-client
  2. Regenerated all ORM client.ts and query-builder.ts files so they use the new @constructive-io/graphql-query/runtime import path (previously @constructive-io/graphql-types and @0no-co/graphql.web)

sdk/constructive-node was not changed — it re-exports from constructive-sdk and has no generated ORM code of its own.

2. Cyclic workspace dependency breaking pgsql-test builds

Removed two phantom dependencies (declared in package.json but never imported in source code) that created a cyclic dependency chain preventing pnpm build from determining correct topological build order:

pgsql-client → @pgpmjs/core → @pgpmjs/migrate-client →
  @constructive-io/graphql-query → graphile-settings → pgsql-test → pgsql-client

This cycle caused pgsql-test (and its ~47 downstream CI test jobs) to fail when building from clean dist/ folders, because pnpm couldn't guarantee that pgsql-client and pgsql-seed were built before pgsql-test.

Removed:

  • @pgpmjs/migrate-client from pgpm/core/package.json dependencies — @pgpmjs/core never imports from @pgpmjs/migrate-client in its source
  • pgsql-test from graphile/graphile-settings/package.json devDependencies — graphile-settings never imports from pgsql-test in its source

After removal, pnpm install no longer reports cyclic workspace dependencies, and pnpm -r run clean && pnpm -r run build completes successfully.

Review & Testing Checklist for Human

  • Verify the two removed dependencies are truly phantom — grep pgpm/core/src/ for any import/require of @pgpmjs/migrate-client, and grep graphile/graphile-settings/src/ for any import/require of pgsql-test. Neither should appear. If either does, the removal will break that package at runtime.
  • Verify pnpm-lock.yaml changes are only the expected removals + 4 new dependency links — the lockfile diff is large due to @types/node version resolution changes (25.5.022.19.15) which are a cosmetic side effect of the pnpm remove commands, not a functional change
  • Check whether @0no-co/graphql.web and @constructive-io/graphql-types are still needed as direct dependencies in each SDK package, or if they're now dead weight (the node-fetch.ts template still imports @constructive-io/graphql-types directly, so at least that one likely needs to stay)
  • Verify constructive-db CI passes after merge — the original error was surfaced in constructive-db PR #946 CI
  • Consider external consumers — any third-party project that runs @constructive-io/graphql-codegen with orm: true will also need @constructive-io/graphql-query in their dependencies. This gap exists in the codegen itself (it doesn't manage consumer deps). Worth a follow-up to document this or have codegen warn/auto-add.

Recommended test: pnpm -r run clean && pnpm -r run build from the repo root — this validates both that the SDK packages resolve the new import and that the cyclic dependency no longer blocks pgsql-test from building.

Notes

  • The generated file diffs look large but are purely mechanical — the codegen formatter changed some whitespace alongside the import path changes. No hand-edited logic in generated files.
  • The @types/node version resolution change in the lockfile (25.5.022.19.15) is a harmless side effect of pnpm re-resolving after the dependency removals. It does not change which @types/node version is installed.

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

…ate ORM code

PR #1023 changed codegen templates to import from
@constructive-io/graphql-query/runtime instead of directly from
@constructive-io/graphql-types and @0no-co/graphql.web.

The SDK packages (constructive-cli, constructive-sdk, constructive-react,
migrate-client) were missing @constructive-io/graphql-query as a dependency,
causing TS2307 'Cannot find module' errors when building regenerated code.

Fix:
- Add @constructive-io/graphql-query: workspace:^ to all 4 SDK package.json
- Regenerate all SDK ORM code with updated codegen templates
@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 and CI monitoring

…hile-settings -> pgsql-test)

Break the cyclic dependency chain that prevented pgsql-test from building
in CI. The cycle was:

  pgsql-client -> @pgpmjs/core -> @pgpmjs/migrate-client ->
  @constructive-io/graphql-query -> graphile-settings -> pgsql-test ->
  pgsql-client

Both removed deps were phantom (declared but never imported in source):
- @pgpmjs/core listed @pgpmjs/migrate-client as a production dep but
  never imports it in src/
- graphile-settings listed pgsql-test as a devDep but never imports it
  in src/
@devin-ai-integration devin-ai-integration Bot changed the title fix: add @constructive-io/graphql-query dep to SDK packages + regenerate ORM code fix: add graphql-query dep to SDK packages + break cyclic workspace dependency Apr 27, 2026
@pyramation pyramation merged commit 75ca7f5 into main Apr 27, 2026
51 checks passed
@pyramation pyramation deleted the devin/1777255014-fix-runtime-dep branch April 27, 2026 02:57
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