computed fields breaking studio
Maintainer thường phản hồi trong vòng 1 ngày
@jiashengguo đang làm issue này rồi.
Từ ngày 8/10/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 27/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- nodejs, postgresql, typescript
- Lĩnh vực
- tooling
Hướng nghiên cứu
The reporter's computed fields live in their computedFields.ts as a Kysely-style SQL resolver, and API queries work; only Studio's proxy runtime fails. Read where Studio constructs its proxy Prisma client and where the computed-fields plugin/handler is registered, then reproduce with the Bid, BidSubmission, Project and Opportunity models on PostgreSQL. Done means Studio resolves computed fields, or the limitation is documented with a test covering the proxy path.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description and expected behavior
Yes, this appears to be a ZenStack Studio limitation/bug.
Your computed fields work perfectly at the API level (we proved this), but Studio's proxy runtime doesn't have access to the SQL implementations in computedFields.ts, so it can't display them.
What's Working ✅
Computed field definitions in schema
SQL resolver implementations
API queries return correct values
Application runtime has everything it needs
What's Not Working ❌
Studio UI proxy - can't resolve computed fields
Studio tables for Bid, BidSubmission, Project, Opportunity models
Recommendation
Since the API works perfectly and that's what your app uses, this is safe to ignore for now. If you need to browse data with computed fields:
Use the test script: pnpm run test:computed-fields
Or query the API directly
Studio's lack of computed field display is a presentation issue, not a data issue
Consider reporting this to ZenStack if you haven't already - they should support computed fields in Studio.
Screenshots
Environment (please complete the following information):
- ZenStack version: [e.g., 3.9.7]
- Database type: Postgresql
- Node.js/Bun version: v26.8.2
- Package manager: pnpm
Additional context
I am writing computed fields like this as kysely doesnt work
// The baseTotalPrice is a computed field that calculates the total price of the bid based on the related estimates. It sums up the product of quantity and unitPrice for all EstimateLineItems associated with the bid, providing a dynamic calculation of the bid's total value. Returns 0 if no estimates exist.
baseTotalPrice: (_eb, { modelAlias }) => {
const bidIdRef = sql.ref(${modelAlias}.id)
return sql<number>`COALESCE((
SELECT COALESCE(SUM("EstimateLineItem"."quantity" * "EstimateLineItem"."unitPrice"), 0)
FROM "EstimateLineItem"
INNER JOIN "Estimate" ON "EstimateLineItem"."estimateId" = "Estimate"."id"
WHERE "Estimate"."bidId" = ${bidIdRef}
), 0)`
},
- Ngôn ngữ chính
- TypeScript
- Star
- 2.9k
- Fork
- 157
- Merge trung bình
- 2 ngày 46 phút
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của zenstackhq/zenstack
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
zenstackhq/zenstack#2873 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`@default` on a field of a `@map`-ed enum emits the enum name as the column defaultCó thể đã có người làm @jkugsiya đã nhận 6 ngày trước. Đang mởruntime
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
zenstackhq/zenstack#2868 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
zenstackhq/zenstack#2694 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
zenstackhq/zenstack#2659 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
zenstackhq/zenstack#2542 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của zenstackhq/zenstack
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
simkimsia/netlify-axi#19 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
subhranshudash13-dotcom/Contribo#74 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement frontend good first issue Stellar Wave trivial
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Godgift-care/sci-healthcare-frontend#166 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backend good first issue security Stellar Wave trivial
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Godgift-care/sci-healthcare-backend#171 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày