Skip to content

docs(prisma): show zod field errors in the create example - #9374

Merged
Varixo merged 1 commit into
QwikDev:mainfrom
ankur-arch:docs/prisma-zod-field-errors
Nov 4, 2026
Merged

Varixo merged 1 commit into
QwikDev:mainfrom
ankur-arch:docs/prisma-zod-field-errors

Conversation

@ankur-arch

@ankur-arch ankur-arch commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What is it?

  • Docs / tests / types / typos

Description

Small follow-up to #9357, which merged this morning. In the "Adding a user" example, a zod$ validation failure sets createUserAction.value.failed but not message, so the page's form rendered an empty <p> for an invalid email. The example now renders value.message ?? value.fieldErrors?.email, so the form shows "Email already in use" on a duplicate and "Invalid email" on bad input. One sentence above the code block explains where zod$ puts its errors.

This came out of a CodeRabbit comment on #9358, whose starter route has the same fix (5f95360). Verified on a fresh npm create qwik@rc -- empty app with the route copied from this page: tsc passes, an invalid email returns 400 with "Invalid email" in the HTML, a duplicate returns 409 with "Email already in use".

Checklist

Summary by CodeRabbit

  • Documentation
    • Clarified how Prisma form validation errors are reported and displayed, including field-specific email errors and action messages.

@ankur-arch
ankur-arch requested a review from a team as a code owner November 4, 2026 08:38
@changeset-bot

changeset-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 76a025e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Prisma guide now documents how zod$ validation failures populate failed and fieldErrors. The create-user form displays the email field error when no action message is present.

Changes: Prisma validation feedback

Layer / File(s) Summary
Document validation feedback
packages/docs/src/routes/docs/integrations/prisma/index.mdx
The guide explains that zod$ validation failures set failed and provide messages in fieldErrors. The form displays fieldErrors.email when message is absent.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Possibly related PRs

  • QwikDev/qwik#9357: This PR edits the Prisma create example introduced by that PR and documents validation feedback from its zod$ usage.

Suggested reviewers: wmertens

Merge Risk: Minimal · up to 76a02

This documentation-only change correctly explains and renders Zod email validation feedback.

Architecture risk: Low · up to 76a02

The change affects 1 system.

Changed systems: packages/docs

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/docs (api) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/docs/src/routes/docs/integrations/prisma/index.mdx: The duplicate-email explanation now also documents that zod$ validation failures set failed and provide messages in fieldErrors; the form displays either validation feedback or the existing duplicate-email message.
  • observed — Modified behavior in packages/docs/src/routes/docs/integrations/prisma/index.mdx: The failure message rendering now falls back to fieldErrors.email when message is absent.
Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the documentation change to show Zod field errors in the Prisma create example.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: df68a044-1abb-4b74-951e-89ad0c5e269a
Commits

Reviewing files that changed from the base of the PR and between fc71359 and 76a025e.

Files selected for processing: 1
  • packages/docs/src/routes/docs/integrations/prisma/index.mdx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@pkg-pr-new

pkg-pr-new Bot commented Nov 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@9374

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@9374

@qwik.dev/utils

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/utils@9374

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@9374

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@9374

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@9374

@qwik.dev/devtools

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/devtools@9374

@qwik.dev/mcp

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/mcp@9374

commit: 76a025e

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

⚡ Docs preview for 76a025e

@Varixo Varixo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this

@Varixo
Varixo merged commit bab2cbe into QwikDev:main Nov 4, 2026
106 of 108 checks passed
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.

2 participants