Skip to content

fix(graphql-codegen): re-export input types from generated ORM index#890

Merged
pyramation merged 2 commits intomainfrom
devin/1774426400-export-input-types
Mar 25, 2026
Merged

fix(graphql-codegen): re-export input types from generated ORM index#890
pyramation merged 2 commits intomainfrom
devin/1774426400-export-input-types

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

@pyramation pyramation commented Mar 25, 2026

Summary

The generated ORM index.ts was missing export * from './types', which meant input types like SecureTableProvision, RelationProvision, Blueprint, Field, Index, Policy, FullTextSearch, etc. were not accessible through the SDK's public namespace.

Previously, only select-types and models were re-exported from the ORM index. The types.ts barrel (which chains to input-types.ts via export * from './input-types') was generated but never wired into the index — so consumers couldn't do:

import type { public_ } from '@constructive-io/sdk';
type STP = public_.SecureTableProvision; // ❌ TS2724: has no exported member

Changes

  • client-generator.ts: Added export * from './types' to the generated ORM index.ts
  • Added explicit export type { ConnectionResult, PageInfo } from './select-types' to resolve TS2308 ambiguity (both select-types and input-types define these interfaces; the explicit re-export tells TypeScript to prefer the select-types versions)
  • Updated 2 test snapshots to match

Name collision fix

A naive export * from './types' causes TS2308 errors because ConnectionResult and PageInfo are defined in both select-types.ts (template) and input-types.ts (generated from schema). TypeScript's recommended resolution is an explicit named re-export, which is what this PR adds. Verified locally against @constructive-io/sdk@0.11.1tsc --noEmit passes cleanly on a downstream consumer after patching.

Review & Testing Checklist for Human

  • Check for additional name collisions: Only ConnectionResult and PageInfo were found to conflict between select-types and input-types. After regenerating the SDK, run tsc --noEmit on a downstream consumer (e.g. agentic-db) to confirm no other names clash. The check was done against SDK 0.11.1 — a fresh regeneration may surface new conflicts if types were added since.
  • Regenerate + publish: After merging, regenerate the SDK and verify that import type { public_ } from '@constructive-io/sdk'; type T = public_.SecureTableProvision; compiles cleanly.
  • Verify input-types standalone usage: Confirm that files importing directly from ./input-types (e.g. model files, custom-ops) still compile, since ConnectionResult/PageInfo remain declared there (just also explicitly re-exported from select-types in the index).

Notes

  • The types.ts barrel file was already being generated by generateTypesBarrel() in barrel.ts — it just was never re-exported from the ORM index.ts. This fix wires it in.
  • Downstream consumer (agentic-db) is blocked on this fix to replace hand-rolled type definitions with SDK imports.

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

The generated ORM index.ts was missing `export * from './types'`, which
meant that input types like SecureTableProvision, RelationProvision,
Blueprint, Field, Index, Policy, FullTextSearch, etc. were not accessible
through the public namespace (e.g. `import { public_ } from '@constructive-io/sdk'`).

This adds the missing re-export so downstream consumers can import these
types directly without reaching into internal paths.
@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

@pyramation pyramation merged commit 43cfffe into main Mar 25, 2026
44 checks passed
@pyramation pyramation deleted the devin/1774426400-export-input-types branch March 25, 2026 08: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