Skip to content

feat(gqlorm): TS type gen#1619

Merged
Tobbe merged 2 commits intomainfrom
tobbe-feat-gqlorm-ts-types
Apr 14, 2026
Merged

feat(gqlorm): TS type gen#1619
Tobbe merged 2 commits intomainfrom
tobbe-feat-gqlorm-ts-types

Conversation

@Tobbe
Copy link
Copy Markdown
Member

@Tobbe Tobbe commented Apr 14, 2026

Generate types for useLiveQuery

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 14, 2026

Deploy Preview for cedarjs ready!

Name Link
🔨 Latest commit 5bba1e4
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/69dde65f68ce3f0008951eed
😎 Deploy Preview https://deploy-preview-1619--cedarjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added this to the next-release milestone Apr 14, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 14, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 5bba1e4

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 2s View ↗
nx run-many -t build ✅ Succeeded 1m 19s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 2m 22s View ↗
nx run-many -t test:types ✅ Succeeded 10s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-14 07:21:50 UTC

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 14, 2026

Greptile Summary

This PR generates a web-gqlorm-models.d.ts declaration file from the Prisma DMMF so useLiveQuery return types are inferred from visible scalar model fields without explicit generics. It also decouples frontend artifact generation from the experimental.gqlorm.enabled flag, adds gqlorm membership config fields, and extends the Prisma schema watcher to trigger regeneration on .prisma file changes.

Confidence Score: 5/5

  • Safe to merge; all findings are non-blocking P2 suggestions.
  • No P0 or P1 issues found. The BigInt type mapping and the stale JSDoc are both P2 quality concerns that don't affect the correctness of the primary use case (BigInt fields in schemas are uncommon). The implementation doc update is accurate. Type inference logic is sound and well-tested.
  • packages/internal/src/generate/gqlormSchema.ts — BigInt type mapping and JSDoc gap

Important Files Changed

Filename Overview
packages/gqlorm/src/types/orm.ts Adds ScalarTypeForModel<TModel> and RemapModelDelegatesToScalarTypes<TDb> to remap db delegates to generated scalar types; cleanly integrated into FrameworkDbClient.
packages/internal/src/generate/gqlormSchema.ts Adds buildFrontendModelInfo and generateWebGqlormModelsContent for scalar type declaration generation; BigInt maps to bigint instead of string, inconsistent with Decimal/Bytes and JSON serialization reality; JSDoc for generateGqlormArtifacts not updated to list the new third output file.
packages/internal/src/generate/generate.ts Removes the experimental.gqlorm.enabled guard so frontend artifacts are always generated; errors caught inside generateGqlormArtifacts and handled gracefully.
packages/internal/src/generate/watch.ts Adds api/db/**/*.prisma glob to chokidar watcher; check uses startsWith+endsWith which covers multi-file schemas; also fixes path import to use node:path.

Reviews (2): Last reviewed commit: "address review comments" | Re-trigger Greptile

Comment thread packages/internal/src/generate/gqlormSchema.ts Outdated
Comment thread packages/internal/src/generate/watch.ts Outdated
@Tobbe Tobbe merged commit 2b32b38 into main Apr 14, 2026
46 checks passed
@Tobbe Tobbe deleted the tobbe-feat-gqlorm-ts-types branch April 14, 2026 07:28
@github-actions
Copy link
Copy Markdown

The changes in this PR are now available on npm.

Try them out by running yarn cedar upgrade -t 4.0.0-canary.13811

Or try it in a new app with yarn dlx create-cedar-app@4.0.0-canary.13811

Tobbe added a commit that referenced this pull request Apr 29, 2026
Generate types for useLiveQuery
@Tobbe Tobbe modified the milestones: next-release, v4.1.0 Apr 30, 2026
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