Skip to content

fix: export Get<Model>GroupByPayload type in prisma-client generator#29346

Merged
jacek-prisma merged 1 commit into
prisma:mainfrom
nurul3101:fix/export-group-by-payload-type
Mar 17, 2026
Merged

fix: export Get<Model>GroupByPayload type in prisma-client generator#29346
jacek-prisma merged 1 commit into
prisma:mainfrom
nurul3101:fix/export-group-by-payload-type

Conversation

@nurul3101
Copy link
Copy Markdown
Member

@nurul3101 nurul3101 commented Mar 17, 2026

Summary

  • Adds export keyword to the Get<Model>GroupByPayload type in client-generator-ts so it's accessible to users after generation

Fixes #29345

Problem

In the prisma-client generator (Prisma 7), Get<Model>GroupByPayload is defined as a private type in each model file:

// generated/models/MealInteraction.ts
export type MealInteractionGroupByArgs = { ... }        // ✅ exported
export type MealInteractionGroupByOutputType = { ... }   // ✅ exported
type GetMealInteractionGroupByPayload<T> = ...           // ❌ NOT exported

In the old prisma-client-js generator, this type was accessible via the Prisma namespace (Prisma.GetMealInteractionGroupByPayload<{...}>). With the new per-model-file architecture, the missing export makes it completely unreachable.

Fix

One-line change in packages/client-generator-ts/src/TSClient/Model.ts:

-type ${getGroupByPayloadName(model.name)}<T extends ${groupByArgsName}> = Prisma.PrismaPromise<
+export type ${getGroupByPayloadName(model.name)}<T extends ${groupByArgsName}> = Prisma.PrismaPromise<

Test plan

  • Run prisma generate with prisma-client generator
  • Verify GetMealInteractionGroupByPayload is now exported from the generated model file
  • Verify it can be imported from the models barrel export
  • Verify Awaited<GetMealInteractionGroupByPayload<{ by: [...], _count: {...} }>> resolves correctly

Summary by CodeRabbit

  • New Features
    • The GroupBy payload type is now publicly exportable and can be imported for use in your TypeScript applications.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 17, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7e2c8e7c-ee5d-4e13-b46d-da5a33a50aa1

📥 Commits

Reviewing files that changed from the base of the PR and between e97b3e0 and 524e7f9.

📒 Files selected for processing (1)
  • packages/client-generator-ts/src/TSClient/Model.ts

Walkthrough

The change adds the export keyword to the Get<Model>GroupByPayload type alias declaration in the TypeScript client generator, making the type publicly accessible from generated model files.

Changes

Cohort / File(s) Summary
GroupByPayload type export
packages/client-generator-ts/src/TSClient/Model.ts
Added export keyword to the Get<Model>GroupByPayload type alias declaration, making the type publicly importable alongside other sibling exported types like GroupByArgs and GroupByOutputType.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: exporting the GetGroupByPayload type in the prisma-client generator, which matches the one-line modification in Model.ts.
Linked Issues check ✅ Passed The PR fully addresses issue #29345 by adding the export keyword to the GetGroupByPayload type, making it publicly accessible as required by the linked issue.
Out of Scope Changes check ✅ Passed The PR contains only the single necessary change to export the GroupByPayload type; no extraneous modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

@jacek-prisma jacek-prisma merged commit 67b6986 into prisma:main Mar 17, 2026
251 of 253 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.

Get<Model>GroupByPayload type not exported in prisma-client generator

3 participants