Skip to content

Update GraphQL examples#8327

Merged
AmanVarshney01 merged 20 commits into
latestfrom
update-graphql-examples
Oct 27, 2025
Merged

Update GraphQL examples#8327
AmanVarshney01 merged 20 commits into
latestfrom
update-graphql-examples

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented Oct 15, 2025

Copy link
Copy Markdown
Member

@coderabbitai

coderabbitai Bot commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between 6e19a09 and 1fc1c78.

📒 Files selected for processing (6)
  • orm/graphql/lib/pothos-prisma-types.ts (1 hunks)
  • orm/graphql/prisma/schema.prisma (1 hunks)
  • orm/graphql/src/builder.ts (2 hunks)
  • orm/graphql/src/schema/post.ts (2 hunks)
  • orm/graphql/src/schema/user.ts (1 hunks)
  • orm/graphql/tsconfig.json (1 hunks)

Tip

You can disable sequence diagrams in the walkthrough.

Disable the reviews.sequence_diagrams setting in your project's settings in CodeRabbit to disable sequence diagrams in the walkthrough.

Walkthrough

Move Prisma client generation to local ./prisma/generated across examples, update generator/provider config and imports to use that generated client; bump Prisma/tooling and add @prisma/extension-accelerate; replace ts-node tooling with tsx for dev/seed scripts; add dotenv side-effect imports; broaden .gitignore to ignore generated/; apply minor schema/model edits and generated Pothos types for Next.js.

Changes

Cohort / File(s) Summary
Ignore generated artifacts
./.gitignore
Broaden ignore from generated/prisma/ to generated/.
Package manifests (scripts & deps)
orm/*/*/package.json, orm/*/package.json (e.g. orm/fastify-graphql*/package.json, orm/graphql*/package.json, orm/hapi-graphql*/package.json, orm/nest-graphql*/package.json, orm/nextjs-graphql/package.json, ...)
Replace ts-node/ts-node-dev with tsx for dev/generate/seed scripts; bump @prisma/client & prisma to ^6.18.x; add @prisma/extension-accelerate, dotenv, and tsx as devDependency; remove ts-node entries; update seed scripts to tsx prisma/seed.ts.
Prisma generator reconfiguration
orm/*/.../prisma/schema.prisma (many examples)
Update generator: provider prisma-client-jsprisma-client; add output = "./generated" and engineType = "client" (some files add importFileExtension, clientOutput, or pothos output/generateDatamodel).
Model/schema edits
orm/fastify-graphql/prisma/schema.prisma, orm/graphql-subscriptions/prisma/schema.prisma, orm/nextjs-graphql/prisma/schema.prisma, ...
Minor model changes: add User.name in some examples; add Post model and User.posts relation in subscriptions example; reorder some field annotations (non-semantic).
Seed scripts: import generated client
orm/*/*/prisma/seed.ts (multiple examples)
Replace imports from @prisma/client with relative generated client paths like ./generated/client or ../prisma/generated/client; seeding logic unchanged.
Runtime Prisma imports switched to generated client
orm/*/*/src/* (context/prisma/db/prisma.service/lib/prisma.ts, e.g. orm/*/src/context.ts, orm/*/src/db.ts, orm/*/src/prisma.service.ts, orm/nextjs-graphql/lib/prisma.ts)
Replace import { PrismaClient } from '@prisma/client' with imports from the generated client path and preserve .$extends(withAccelerate()).
Schema sourceTypes module path updates
orm/*/*/src/schema.ts (fastify-graphql, graphql-auth, graphql-nexus, graphql-subscriptions, hapi-graphql, ...)
Change schema/sourceTypes module entries from '@prisma/client' to require.resolve('../prisma/generated/client') for type generation resolution.
Server startup env loading
orm/*/*/src/server.ts, orm/hapi-graphql-sdl-first/src/index.ts, orm/graphql/src/server.ts, orm/graphql-nexus/src/server.ts, orm/nest-graphql-sdl-first/src/context.ts, ...
Add top-level side-effect import dotenv/config to ensure environment variables are loaded before module initialization.
Express/Apollo integration tweak
orm/graphql-subscriptions/src/server.ts
Swap @apollo/server/express4@as-integrations/express5, remove body-parser, use express.json() in route setup.
NestJS config wiring & minor formatting
orm/nest-graphql-sdl-first/src/app.module.ts, orm/nest-graphql/src/app.module.ts
Add @nestjs/config and ConfigModule.forRoot() to AppModule imports; minor whitespace/format changes.
Next.js Pothos types & SchemaBuilder changes
orm/nextjs-graphql/lib/pothos-prisma-types.ts, orm/nextjs-graphql/pages/api/graphql.ts, orm/nextjs-graphql/prisma/schema.prisma
Add generated Pothos Prisma types file and getDatamodel(); supply dmmf via getDatamodel() to SchemaBuilder; add onUnusedQuery handling; adjust prisma/pothos generator blocks and id annotation ordering.
Miscellaneous formatting/tsconfig/next-env/schema
orm/graphql-sdl-first/tsconfig.json, orm/nextjs-graphql/next-env.d.ts, orm/graphql-subscriptions/schema.graphql
Minor formatting changes, tsconfig rootDir set from "src" → ".", next-env comment updated, trivial schema brace formatting.
Dev tooling for .github dev server
.github/get-ppg-dev/index.js, .github/get-ppg-dev/package.json
Add OpenTelemetry bootstrap imports and packages to dev server boot file and package.json.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev
  participant Node as Node (tsx)
  participant Dotenv as dotenv/config
  participant App as App modules (server/schema)
  participant GenClient as ./prisma/generated/client
  participant PrismaExt as withAccelerate

  Dev->>Node: npm run dev (tsx)
  Node->>Dotenv: import "dotenv/config"
  note right of Dotenv #e8f5e9: env vars available before module init
  Node->>App: load server & schema modules
  App->>GenClient: import generated client (relative path)
  GenClient->>PrismaExt: new PrismaClient().$extends(withAccelerate())
  PrismaExt-->>App: extended Prisma client instance
  App-->>Dev: server ready (uses local generated client)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

  • Review focus areas:
    • Verify each prisma schema generator block and generated client output/paths.
    • Confirm all runtime imports and seed scripts point to correct relative generated client paths.
    • Validate package.json script and dependency edits (tsx, prisma versions, seed scripts).
    • Inspect Next.js Pothos datamodel generation and SchemaBuilder dmmf/onUnusedQuery integration.

Possibly related PRs

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Update GraphQL examples" accurately describes the primary action being taken across the changeset: updating and modernizing multiple GraphQL example projects (12 directories listed in the PR objectives). The title correctly identifies what is being updated (GraphQL examples) and the action being performed (Update). While the title does not specify the particular technical changes being made—such as the migration from ts-node to tsx, the Prisma client generation approach update, or the dependency upgrades—it successfully communicates that these examples are undergoing updates and would be understood by a teammate scanning the commit history.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

♻️ Duplicate comments (6)
orm/hapi-graphql-sdl-first/prisma/schema.prisma (1)

2-4: Same generator configuration concerns apply here.

This file has the same potentially invalid generator configuration as orm/graphql-sdl-first/prisma/schema.prisma (provider = "prisma-client" and engineType = "client"). Please verify these settings are valid as part of addressing the issue raised in that file.

orm/graphql-sdl-first/prisma/seed.ts (1)

1-1: Same seed script import path concern applies here.

This file has the same potential module resolution issue as orm/nest-graphql/prisma/seed.ts with the relative import path './generated/client'. Please verify the seed configuration as part of addressing that issue.

orm/nest-graphql-sdl-first/prisma/schema.prisma (1)

2-4: Verify the generator provider value.

Same concern as in orm/nest-graphql/prisma/schema.prisma: the provider "prisma-client" should likely be "prisma-client-js".

See the verification script and fix in the review comment for orm/nest-graphql/prisma/schema.prisma.

orm/graphql-nexus/prisma/schema.prisma (1)

2-4: Verify the generator provider value.

Same concern as in other schema files: the provider "prisma-client" should likely be "prisma-client-js".

See the verification script and fix in the review comment for orm/nest-graphql/prisma/schema.prisma.

orm/nextjs-graphql/prisma/schema.prisma (1)

2-4: Verify the generator provider value.

Same concern as in other schema files: the provider "prisma-client" should likely be "prisma-client-js".

See the verification script and fix in the review comment for orm/nest-graphql/prisma/schema.prisma.

orm/fastify-graphql-sdl-first/prisma/schema.prisma (1)

2-4: Verify the generator provider value.

Same issue as in orm/graphql/prisma/schema.prisma: the provider is set to "prisma-client" instead of the standard "prisma-client-js". This pattern appears across multiple schema files in this PR.

If verification confirms "prisma-client-js" is correct, apply this diff:

 generator client {
-  provider        = "prisma-client"
+  provider        = "prisma-client-js"
   output          = "./generated"
   engineType      = "client"
   previewFeatures = ["relationJoins"]
 }
🧹 Nitpick comments (2)
orm/nextjs-graphql/prisma/schema.prisma (1)

18-18: Annotation order standardized.

The order of field attributes has been standardized to place @id before @default(autoincrement()). This is a stylistic change that improves consistency but doesn't affect functionality.

Also applies to: 26-26

orm/hapi-graphql/package.json (1)

18-25: Drop unnecessary runtime dependencies

  • Remove "@types/node" from dependencies; keep it only in devDependencies.
  • Drop "@prisma/client" from dependencies since seed.ts imports from ./generated/client.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2ce042 and a9ddbec.

📒 Files selected for processing (65)
  • .gitignore (1 hunks)
  • orm/fastify-graphql-sdl-first/package.json (1 hunks)
  • orm/fastify-graphql-sdl-first/prisma/schema.prisma (1 hunks)
  • orm/fastify-graphql-sdl-first/prisma/seed.ts (1 hunks)
  • orm/fastify-graphql-sdl-first/src/context.ts (1 hunks)
  • orm/fastify-graphql-sdl-first/src/server.ts (2 hunks)
  • orm/fastify-graphql/package.json (1 hunks)
  • orm/fastify-graphql/prisma/schema.prisma (1 hunks)
  • orm/fastify-graphql/prisma/seed.ts (1 hunks)
  • orm/fastify-graphql/src/context.ts (1 hunks)
  • orm/fastify-graphql/src/schema.ts (3 hunks)
  • orm/fastify-graphql/src/server.ts (1 hunks)
  • orm/graphql-auth/package.json (1 hunks)
  • orm/graphql-auth/prisma/schema.prisma (1 hunks)
  • orm/graphql-auth/prisma/seed.ts (1 hunks)
  • orm/graphql-auth/src/context.ts (1 hunks)
  • orm/graphql-auth/src/schema.ts (2 hunks)
  • orm/graphql-auth/src/server.ts (1 hunks)
  • orm/graphql-nexus/package.json (1 hunks)
  • orm/graphql-nexus/prisma/schema.prisma (1 hunks)
  • orm/graphql-nexus/prisma/seed.ts (1 hunks)
  • orm/graphql-nexus/src/context.ts (1 hunks)
  • orm/graphql-nexus/src/schema.ts (2 hunks)
  • orm/graphql-nexus/src/server.ts (1 hunks)
  • orm/graphql-sdl-first/package.json (1 hunks)
  • orm/graphql-sdl-first/prisma/schema.prisma (1 hunks)
  • orm/graphql-sdl-first/prisma/seed.ts (1 hunks)
  • orm/graphql-sdl-first/src/context.ts (1 hunks)
  • orm/graphql-sdl-first/src/server.ts (1 hunks)
  • orm/graphql-subscriptions/package.json (1 hunks)
  • orm/graphql-subscriptions/prisma/schema.prisma (1 hunks)
  • orm/graphql-subscriptions/prisma/seed.ts (1 hunks)
  • orm/graphql-subscriptions/src/context.ts (1 hunks)
  • orm/graphql-subscriptions/src/schema.ts (2 hunks)
  • orm/graphql-subscriptions/src/server.ts (1 hunks)
  • orm/graphql/package.json (1 hunks)
  • orm/graphql/prisma/schema.prisma (1 hunks)
  • orm/graphql/prisma/seed.ts (1 hunks)
  • orm/graphql/src/db.ts (1 hunks)
  • orm/graphql/src/server.ts (1 hunks)
  • orm/hapi-graphql-sdl-first/package.json (1 hunks)
  • orm/hapi-graphql-sdl-first/prisma/schema.prisma (1 hunks)
  • orm/hapi-graphql-sdl-first/prisma/seed.ts (1 hunks)
  • orm/hapi-graphql-sdl-first/src/context.ts (1 hunks)
  • orm/hapi-graphql-sdl-first/src/index.ts (1 hunks)
  • orm/hapi-graphql/package.json (1 hunks)
  • orm/hapi-graphql/prisma/schema.prisma (1 hunks)
  • orm/hapi-graphql/prisma/seed.ts (1 hunks)
  • orm/hapi-graphql/src/context.ts (1 hunks)
  • orm/hapi-graphql/src/schema.ts (2 hunks)
  • orm/hapi-graphql/src/server.ts (1 hunks)
  • orm/nest-graphql-sdl-first/package.json (2 hunks)
  • orm/nest-graphql-sdl-first/prisma/schema.prisma (1 hunks)
  • orm/nest-graphql-sdl-first/prisma/seed.ts (1 hunks)
  • orm/nest-graphql-sdl-first/src/app.module.ts (1 hunks)
  • orm/nest-graphql-sdl-first/src/context.ts (1 hunks)
  • orm/nest-graphql/package.json (2 hunks)
  • orm/nest-graphql/prisma/schema.prisma (1 hunks)
  • orm/nest-graphql/prisma/seed.ts (1 hunks)
  • orm/nest-graphql/src/app.module.ts (2 hunks)
  • orm/nest-graphql/src/prisma.service.ts (1 hunks)
  • orm/nextjs-graphql/lib/prisma.ts (1 hunks)
  • orm/nextjs-graphql/package.json (1 hunks)
  • orm/nextjs-graphql/prisma/schema.prisma (2 hunks)
  • orm/nextjs-graphql/prisma/seed.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-22T12:12:24.602Z
Learnt from: FGoessler
PR: prisma/prisma-examples#8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.

Applied to files:

  • orm/graphql-subscriptions/prisma/seed.ts
  • orm/graphql-auth/prisma/seed.ts
  • orm/graphql-nexus/prisma/seed.ts
  • orm/graphql/prisma/seed.ts
  • orm/nest-graphql/prisma/seed.ts
  • orm/fastify-graphql-sdl-first/prisma/seed.ts
  • orm/graphql-sdl-first/prisma/seed.ts
  • orm/nextjs-graphql/prisma/seed.ts
  • orm/nest-graphql/package.json
  • orm/hapi-graphql/prisma/seed.ts
  • orm/hapi-graphql-sdl-first/prisma/seed.ts
  • orm/nest-graphql-sdl-first/package.json
  • orm/fastify-graphql/package.json
  • orm/graphql/package.json
  • orm/nest-graphql-sdl-first/prisma/seed.ts
  • orm/fastify-graphql/prisma/seed.ts
🧬 Code graph analysis (6)
orm/fastify-graphql/src/schema.ts (2)
orm/prisma-mocking-javascript/client.js (1)
  • require (1-1)
orm/nuxt/prisma/seed.js (2)
  • require (1-1)
  • require (2-2)
orm/hapi-graphql/src/schema.ts (2)
orm/prisma-mocking-javascript/client.js (1)
  • require (1-1)
orm/nuxt/prisma/seed.js (2)
  • require (1-1)
  • require (2-2)
orm/graphql-nexus/src/schema.ts (2)
orm/prisma-mocking-javascript/client.js (1)
  • require (1-1)
orm/nuxt/prisma/seed.js (2)
  • require (1-1)
  • require (2-2)
orm/graphql-auth/src/schema.ts (2)
orm/prisma-mocking-javascript/client.js (1)
  • require (1-1)
orm/nuxt/prisma/seed.js (2)
  • require (1-1)
  • require (2-2)
orm/graphql-subscriptions/src/schema.ts (2)
orm/prisma-mocking-javascript/client.js (1)
  • require (1-1)
orm/nuxt/prisma/seed.js (2)
  • require (1-1)
  • require (2-2)
orm/nest-graphql-sdl-first/src/app.module.ts (1)
orm/nest-graphql-sdl-first/src/context.ts (1)
  • context (10-12)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test (orm/solid-start)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/nuxt)
🔇 Additional comments (76)
orm/nest-graphql/src/app.module.ts (1)

8-8: LGTM! ConfigModule addition follows NestJS best practices.

Adding ConfigModule.forRoot() enables automatic .env file loading, which is appropriate for managing environment-specific configuration like database connection strings.

Also applies to: 17-17

.gitignore (1)

7-7: LGTM! Broader ignore pattern aligns with generator changes.

The updated rule generated/ appropriately ignores all locally generated client directories across the project, which aligns with the new output = "./generated" configuration in multiple schema.prisma files.

orm/hapi-graphql-sdl-first/src/index.ts (1)

1-1: LGTM! Environment loading positioned correctly.

The import 'dotenv/config' at the top ensures environment variables are loaded before any other modules, which is the recommended pattern for server entry points.

orm/graphql-sdl-first/src/server.ts (1)

1-1: LGTM! Environment loading follows best practices.

The import 'dotenv/config' at the top of the server entry point ensures environment variables are available before Prisma client initialization and server startup.

orm/nest-graphql/prisma/seed.ts (1)

1-1: Incorrect assumption about seed script import resolution. Relative imports in ES modules resolve against the script’s file location, so ./generated/client in prisma/seed.ts will import correctly regardless of the working directory.

Likely an incorrect or invalid review comment.

orm/graphql-sdl-first/prisma/schema.prisma (1)

2-4: Prisma generator configuration is valid. Both provider = "prisma-client" and engineType = "client" are supported options in recent Prisma releases.

orm/fastify-graphql/package.json (1)

10-12: LGTM! Dependency updates align with latest stable versions.

The dependency updates look good:

  • Prisma packages upgraded to ^6.17.1 (latest stable release)
  • @prisma/extension-accelerate ^2.0.2 added for connection pooling and caching capabilities
  • dotenv ^16.4.7 added for environment variable management
  • tsx ^4.20.6 replaces ts-node for faster TypeScript execution in the seed script

These changes are consistent with modern best practices and the PR's objective to update GraphQL examples.

Based on learnings.

Also applies to: 20-22, 26-26

orm/graphql/src/server.ts (1)

1-1: LGTM! Environment variables loaded early in application startup.

The addition of import 'dotenv/config' at the top of the server file is a best practice that ensures environment variables are loaded before any other modules that might depend on them. This aligns with the addition of dotenv as a dependency.

orm/hapi-graphql/prisma/seed.ts (1)

1-1: LGTM! Import path correctly references locally generated client.

The import path change from @prisma/client to ./generated/client is correct for the locally generated Prisma client. Since this seed file is located in the prisma/ directory and the schema's generator outputs to ./generated, the relative path ./generated/client resolves correctly to prisma/generated/client.

orm/nextjs-graphql/prisma/seed.ts (1)

1-1: LGTM! Import path correctly references locally generated client.

The import path change from @prisma/client to ./generated/client is consistent with the other seed files in this PR and correctly references the locally generated Prisma client at prisma/generated/client.

orm/graphql-auth/package.json (1)

19-23: LGTM! Dependency updates consistent across examples.

The dependency updates mirror those in other packages and are consistent with the PR's objectives:

  • Prisma packages upgraded to ^6.17.1 (latest stable)
  • @prisma/extension-accelerate ^2.0.2 added for performance features
  • dotenv ^16.4.7 added for environment management
  • tsx ^4.20.6 replaces ts-node in the seed script for faster execution

The version consistency across all example packages ensures a uniform developer experience.

Based on learnings.

Also applies to: 29-29, 35-37, 41-41

orm/nest-graphql-sdl-first/src/app.module.ts (1)

6-6: Approved: use ConfigModule.forRoot() for environment variable management

ConfigModule.forRoot() is the NestJS-idiomatic way to load .env variables and aligns with dotenv usage across the project.
Environment variables will now be available via process.env throughout the application.

orm/nextjs-graphql/lib/prisma.ts (1)

1-1: LGTM — Prisma client import path matches generator output
The import path (../prisma/generated/client) aligns with output = "./generated" in orm/nextjs-graphql/prisma/schema.prisma.

orm/hapi-graphql/prisma/schema.prisma (1)

2-4: Prisma generator configuration is valid. Verified with npx prisma generate (Prisma v6.17.1) in orm/hapi-graphql—no changes required.

Likely an incorrect or invalid review comment.

orm/graphql-subscriptions/prisma/seed.ts (1)

1-1: Import path aligns with generated client output.

The import path correctly references ./generated/client, which matches the output = "./generated" configuration in the Prisma schema. This change is appropriate.

Note: This import path depends on the generator configuration being correct. Ensure the generator successfully creates the client at ./generated (see concerns raised about the provider value in schema.prisma files).

orm/nest-graphql/package.json (3)

44-44: Good addition for environment configuration.

Adding @nestjs/config is a sensible choice for managing environment variables in NestJS applications, especially given the migration to locally generated Prisma clients.


48-49: Dependency versions are up to date.

The Prisma packages are updated to version 6.17.1 (latest stable as of October 2025), and @prisma/extension-accelerate is at 2.0.2 (latest). The addition of tsx for TypeScript execution is appropriate.

Based on learnings.

Also applies to: 72-72, 77-77


81-81: Seed script migrated to tsx.

Switching from ts-node to tsx is a good choice for faster TypeScript execution. This change is consistent across the PR.

orm/graphql-sdl-first/package.json (2)

12-14: Dependencies updated to latest versions.

All Prisma packages are updated to 6.17.1 (latest), and dotenv 16.4.7 is added for environment variable management. The tsx addition supports the seed script migration.

Based on learnings.

Also applies to: 21-21, 23-23


27-27: Seed script migrated to tsx.

Consistent with the broader PR pattern, this switches seed execution to tsx for improved TypeScript performance.

orm/nextjs-graphql/package.json (2)

17-18: Prisma dependencies updated to latest versions.

Prisma Client and extension-accelerate are updated to their latest stable versions (6.17.1 and 2.0.2 respectively). The tsx addition enables the seed script migration.

Based on learnings.

Also applies to: 31-32


36-36: Seed execution migrated to tsx.

This change aligns with the PR-wide migration to use tsx for seed scripts, providing faster TypeScript execution.

orm/graphql-subscriptions/src/server.ts (1)

1-1: LGTM!

Loading environment variables via dotenv/config at the top of the entry point is the recommended approach, ensuring all environment variables are available before the rest of the application initializes.

orm/graphql-auth/src/server.ts (1)

1-1: LGTM!

Early environment variable loading using dotenv/config is correctly implemented.

orm/graphql-nexus/prisma/seed.ts (1)

1-1: LGTM!

The import path for the locally generated Prisma client is correct.

orm/nest-graphql-sdl-first/prisma/seed.ts (1)

1-1: LGTM!

The import path for the locally generated Prisma client is correct.

orm/fastify-graphql-sdl-first/prisma/seed.ts (1)

1-1: LGTM!

The import path for the locally generated Prisma client is correct.

orm/fastify-graphql-sdl-first/src/context.ts (1)

1-1: LGTM!

The relative import path ../prisma/generated/client is correct for a file in the src/ directory accessing the generated Prisma client in the prisma/generated/ directory.

orm/fastify-graphql/src/server.ts (1)

1-1: LGTM! Environment variables loaded early.

The dotenv/config side-effect import correctly loads environment variables before any other module initialization, ensuring DATABASE_URL and other configuration values are available.

orm/graphql-nexus/src/server.ts (1)

1-1: LGTM! Environment variables loaded early.

The dotenv/config import ensures environment variables are available before module initialization, which is essential for Prisma client configuration.

orm/hapi-graphql-sdl-first/src/context.ts (1)

1-1: LGTM! Local Prisma client import path is correct.

The import path correctly references the locally generated client at ../prisma/generated/client, consistent with the file's location in the src/ directory.

orm/fastify-graphql/prisma/seed.ts (1)

1-1: LGTM! Local Prisma client import path is correct.

The import path ./generated/client is correct for a seed file located in the prisma/ directory, referencing the locally generated client in prisma/generated/.

orm/hapi-graphql/src/server.ts (1)

1-1: LGTM! Environment variables loaded early.

The dotenv/config import correctly loads environment variables before server initialization, ensuring configuration values are available throughout the application.

orm/graphql-auth/src/context.ts (1)

1-1: LGTM! Local Prisma client import path is correct.

The import path correctly references the locally generated client, consistent with the other context files in this PR.

orm/nest-graphql-sdl-first/src/context.ts (1)

1-1: LGTM! Local Prisma client import path is correct.

The import path correctly references the locally generated client at ../prisma/generated/client, maintaining consistency with the other updated examples in this PR.

orm/graphql-subscriptions/src/context.ts (1)

1-1: LGTM! Import path '../prisma/generated/client' matches output = "./generated" in schema.prisma.

orm/graphql-nexus/src/context.ts (1)

1-1: LGTM! Import path correctly updated.

The import path for PrismaClient has been correctly updated to reference the locally generated client. The relative path ../prisma/generated/client properly resolves from the src directory to the prisma/generated location.

orm/fastify-graphql-sdl-first/src/server.ts (1)

1-1: LGTM! Proper dotenv loading at startup.

The dotenv/config side-effect import is correctly placed at the very top of the file, ensuring environment variables are loaded before any other modules that might depend on them. This follows best practices for dotenv usage.

orm/hapi-graphql-sdl-first/prisma/seed.ts (1)

1-1: LGTM! Seed imports correctly updated.

The import path has been correctly updated to reference the locally generated Prisma client at ./generated/client, which properly resolves relative to the prisma directory.

orm/nest-graphql/src/prisma.service.ts (1)

2-2: LGTM! Import path correctly updated.

The PrismaClient import has been properly updated to reference the locally generated client at ../prisma/generated/client, which correctly resolves from the src directory.

orm/graphql-auth/prisma/seed.ts (1)

1-1: LGTM! Seed imports correctly migrated.

The import statement has been properly updated to use the locally generated Prisma client at ./generated/client, which correctly resolves relative to the prisma directory.

orm/hapi-graphql/src/context.ts (1)

1-1: LGTM! Import path correctly updated.

The PrismaClient import has been properly updated to reference the locally generated client at ../prisma/generated/client, which correctly resolves from the src directory to the prisma/generated location.

orm/graphql/src/db.ts (1)

1-1: LGTM! Import path correctly updated.

The PrismaClient import has been properly updated to reference the locally generated client at ../prisma/generated/client, which correctly resolves from the src directory.

orm/hapi-graphql/src/schema.ts (2)

51-55: LGTM: Formatting adjustment only.

The OR filter construction logic remains unchanged; only brace placement was adjusted for consistency.


304-304: LGTM: Module resolution updated for local client.

The change to use require.resolve('../prisma/generated/client') correctly points to the locally generated Prisma client, aligning with the generator output configuration in the schema.

orm/graphql-nexus/package.json (3)

20-25: LGTM: Dependency updates look good.

The updates to @prisma/client@^6.17.1, addition of @prisma/extension-accelerate@^2.0.2, and dotenv@^16.4.7 align with the latest stable versions. Based on learnings, these are all current and stable releases.


29-32: LGTM: Dev dependency updates are appropriate.

Adding tsx@^4.20.6 as a devDependency is consistent with the seed script change below.


35-35: LGTM: Seed script updated to use tsx.

The change from ts-node to tsx for running the seed script is consistent with the addition of tsx as a devDependency and represents a modern approach to running TypeScript files directly.

orm/hapi-graphql-sdl-first/package.json (2)

13-17: LGTM: Dependency updates are consistent.

Updates match the pattern established in other packages: Prisma 6.17.1, extension-accelerate 2.0.2, and dotenv 16.4.7 are all stable versions.


21-26: LGTM: Dev dependencies and seed script updated consistently.

The addition of tsx and the corresponding seed script update maintain consistency with other packages in this PR.

orm/graphql-subscriptions/package.json (2)

20-30: LGTM: Dependencies updated consistently.

All dependency updates follow the established pattern and use stable versions verified in learnings.


38-45: LGTM: Dev dependencies and seed configuration updated.

Changes are consistent with other packages in this PR.

orm/graphql-sdl-first/src/context.ts (1)

1-1: LGTM: Import updated for local generated client.

The import path '../prisma/generated/client' correctly points to the locally generated Prisma client, aligning with the schema configuration's output = "./generated".

orm/fastify-graphql/src/context.ts (1)

1-1: LGTM: Import updated for local generated client.

The import path change is consistent with other files in this PR and correctly references the generated client location.

orm/graphql/prisma/schema.prisma (1)

2-4: No change needed for Prisma generator provider. "prisma-client" is a valid ESM-friendly generator in Prisma 6.17.1 when an explicit output path is provided, as configured.

orm/graphql-subscriptions/src/schema.ts (2)

76-80: LGTM! Formatting adjustment with no semantic change.

The OR filter structure remains functionally identical; only the formatting has been adjusted for consistency.


200-200: Prisma generator configuration verified
The Prisma schema’s generator client outputs to ./generated, matching the updated module path.

orm/graphql-auth/src/schema.ts (2)

69-73: LGTM! Formatting adjustment with no semantic change.

The OR filter structure remains functionally identical; only the formatting has been adjusted for consistency.


358-358: Module resolution updated to use locally generated Prisma client.

This change aligns with the PR's migration pattern to use a locally generated Prisma client at ../prisma/generated/client instead of the global @prisma/client package. Ensure that the corresponding Prisma schema has the appropriate generator configuration with output = "./generated".

orm/fastify-graphql/src/schema.ts (3)

14-14: Import path updated to use locally generated Prisma client.

The import path has been updated from .prisma/client to ../prisma/generated/client, aligning with the PR's migration to use a locally generated Prisma client.


53-57: LGTM! Formatting adjustment with no semantic change.

The OR filter structure remains functionally identical; only the formatting has been adjusted for consistency.


309-309: Module resolution updated to use locally generated Prisma client.

This change aligns with the PR's migration pattern to use a locally generated Prisma client at ../prisma/generated/client.

orm/graphql/package.json (3)

30-32: DevDependency updates for tooling migration.

The prisma package has been updated to match the client version (^6.17.1), and tsx has been added to replace ts-node for running TypeScript files, which is consistent with the seed script changes.


36-36: Seed script migrated from ts-node to tsx.

The seed command has been updated to use tsx instead of ts-node, which is a faster and more modern TypeScript execution tool. This change aligns with the addition of tsx in devDependencies.


21-23: Approve dependency and tooling updates

Prisma packages updated to v6.17.1, @prisma/extension-accelerate v2.0.2, dotenv v16.4.7, and tsx integration for seeding are correct; dotenv import verified in orm/graphql/src/server.ts.

orm/graphql-nexus/src/schema.ts (2)

52-56: LGTM! Formatting adjustment with no semantic change.

The OR filter structure remains functionally identical; only the formatting has been adjusted for consistency.


305-305: Module resolution updated to use locally generated Prisma client.

This change aligns with the PR's migration pattern to use a locally generated Prisma client at ../prisma/generated/client.

orm/fastify-graphql-sdl-first/package.json (3)

24-26: DevDependency updates for tooling migration.

The prisma package has been updated to ^6.17.1, and tsx has been added to replace ts-node, aligning with the seed script migration.


30-30: Seed script migrated from ts-node to tsx.

The seed command has been updated to use tsx instead of ts-node, consistent with the addition of tsx in devDependencies.


15-20: Approve dependency updates

dotenv is loaded via import 'dotenv/config'; Prisma v6.17.1 (with extension-accelerate v2.0.2) and mercurius v16.2.0 are correctly updated.

orm/nest-graphql-sdl-first/package.json (4)

49-50: Dependency updates align with latest stable versions.

The Prisma packages have been updated to version 6.17.1, and @prisma/extension-accelerate (v2.0.2) has been added, consistent with the PR's migration pattern.

Based on learnings: Prisma 6.17.1 includes important bug fixes for Unsupported field diffing in migrations.


73-78: DevDependency updates for tooling migration.

The prisma package has been updated to ^6.17.1, and tsx has been added, aligning with the seed script migration to replace ts-node.


82-82: Seed script migrated from ts-node to tsx.

The seed command has been updated to use tsx instead of ts-node. Based on learnings: When analyzing seed script changes, always verify the actual prisma configuration to ensure the seed script is properly configured.


45-45: No action needed for @nestjs/config – ConfigModule is imported in src/app.module.ts and configured via ConfigModule.forRoot().

orm/hapi-graphql/package.json (2)

35-35: Seed via tsx LGTM.

Using tsx for prisma.seed is consistent with the repo direction.


21-21: dotenv already loaded via import
orm/hapi-graphql/src/server.ts:1 includes import 'dotenv/config', so no script updates required.

Comment thread orm/fastify-graphql/prisma/schema.prisma
Comment thread orm/graphql-auth/prisma/schema.prisma
Comment thread orm/graphql-subscriptions/prisma/schema.prisma
Comment thread orm/graphql/prisma/seed.ts
Comment thread orm/hapi-graphql/package.json Outdated
Comment thread orm/nest-graphql/prisma/schema.prisma
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 15, 2025
Comment thread orm/nest-graphql-sdl-first/src/app.module.ts
Comment thread orm/fastify-graphql/package.json
Comment thread orm/fastify-graphql-sdl-first/package.json
Comment thread orm/graphql/package.json
Comment thread orm/graphql-auth/package.json
Comment thread orm/graphql-sdl-first/prisma/schema.prisma
Comment thread orm/graphql-sdl-first/package.json
Comment thread orm/graphql-subscriptions/package.json
Comment thread orm/hapi-graphql/package.json
Comment thread orm/nextjs-graphql/package.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (3)
orm/graphql-auth/package.json (1)

5-5: LGTM! Consistent tsx migration across all scripts.

The migration from ts-node/ts-node-dev to tsx for dev, generate:nexus, and seed scripts is consistent and addresses the ESM/CJS compatibility issues mentioned in past comments.

Also applies to: 11-11, 36-36, 40-40

orm/hapi-graphql/package.json (1)

6-6: LGTM! tsx migration is consistent.

All scripts (dev, generate:nexus, seed) now use tsx, addressing the issues mentioned in past comments.

Also applies to: 12-12, 30-30, 34-34

orm/graphql-subscriptions/package.json (1)

5-5: LGTM! Consistent tsx migration.

All execution scripts now use tsx, matching the pattern across other examples in this PR.

Also applies to: 11-11, 38-38, 42-42

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ee6924 and c46fd42.

📒 Files selected for processing (14)
  • orm/fastify-graphql-sdl-first/package.json (2 hunks)
  • orm/fastify-graphql/package.json (1 hunks)
  • orm/graphql-auth/package.json (1 hunks)
  • orm/graphql-nexus/package.json (2 hunks)
  • orm/graphql-sdl-first/package.json (1 hunks)
  • orm/graphql-subscriptions/package.json (2 hunks)
  • orm/graphql-subscriptions/schema.graphql (1 hunks)
  • orm/graphql-subscriptions/src/server.ts (2 hunks)
  • orm/graphql/package.json (2 hunks)
  • orm/hapi-graphql/package.json (1 hunks)
  • orm/nest-graphql-sdl-first/package.json (2 hunks)
  • orm/nest-graphql-sdl-first/src/context.ts (1 hunks)
  • orm/nextjs-graphql/next-env.d.ts (1 hunks)
  • orm/nextjs-graphql/prisma/schema.prisma (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • orm/graphql-subscriptions/schema.graphql
  • orm/nextjs-graphql/next-env.d.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • orm/nest-graphql-sdl-first/package.json
  • orm/nest-graphql-sdl-first/src/context.ts
  • orm/fastify-graphql/package.json
  • orm/fastify-graphql-sdl-first/package.json
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: FGoessler
PR: prisma/prisma-examples#8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.
📚 Learning: 2025-10-15T13:58:59.096Z
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#8327
File: orm/graphql-auth/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:59.096Z
Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.

Applied to files:

  • orm/nextjs-graphql/prisma/schema.prisma
📚 Learning: 2025-10-15T13:58:29.130Z
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#8327
File: orm/fastify-graphql/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:29.130Z
Learning: In Prisma v6.15 and later, `provider = "prisma-client"` is a valid generator configuration value when combined with `engineType = "client"`. This configuration generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead, and is different from the traditional `provider = "prisma-client-js"` configuration.

Applied to files:

  • orm/nextjs-graphql/prisma/schema.prisma
📚 Learning: 2025-10-15T13:56:01.807Z
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#8327
File: orm/graphql-subscriptions/prisma/schema.prisma:1-5
Timestamp: 2025-10-15T13:56:01.807Z
Learning: In Prisma v6.15 and later, `engineType = "client"` is a valid generator configuration value that generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead (e.g., prisma/adapter-pg). This is useful for edge and serverless deployments.

Applied to files:

  • orm/nextjs-graphql/prisma/schema.prisma
📚 Learning: 2025-08-22T12:12:24.602Z
Learnt from: FGoessler
PR: prisma/prisma-examples#8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.

Applied to files:

  • orm/hapi-graphql/package.json
  • orm/graphql/package.json
  • orm/graphql-sdl-first/package.json
🧬 Code graph analysis (1)
orm/graphql-subscriptions/src/server.ts (1)
orm/graphql-subscriptions/src/context.ts (1)
  • context (14-17)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/nextjs)
🔇 Additional comments (10)
orm/graphql/package.json (3)

5-5: Verification confirms proper dotenv bootstrapping—review comment concerns are addressed.

The script found import 'dotenv/config' at line 1 of orm/graphql/src/server.ts, which is the correct and idiomatic pattern for bootstrapping environment variables in Node.js applications. Combined with the tsx replacement (which resolves the past ESM error), the package.json changes are properly implemented.


21-23: All dependency concerns verified and resolved.

The @prisma/extension-accelerate integration is correctly configured in orm/graphql/src/db.ts with proper $extends(withAccelerate()) application. Version compatibility is confirmed: @prisma/extension-accelerate v2.0.2 is compatible with @prisma/client ^6.17.1 (Accelerate requires ≥4.16.1). The generated Prisma client will be created at build time via the existing prisma generate script, and all package versions are mutually consistent.


5-5: No changes needed—tsx switch successfully addresses the ESM/CommonJS interop issue.

Verification confirms the fix is properly implemented: tsx ^4.20.6 is installed in devDependencies, both line 5 ("dev": "tsx src/server") and line 9 ("build:schema": "tsx src/schema/index.ts") use tsx, TypeScript config enables esModuleInterop, Prisma client is ESM-configured, and no CommonJS/ESM incompatibilities remain in the codebase. tsx is explicitly designed to seamlessly handle both CommonJS and ESM, making it a strong replacement for ts-node-dev which lacked proper ESM support.

orm/graphql-sdl-first/package.json (2)

4-4: LGTM! Migration to tsx addresses ESM/CJS compatibility issues.

The switch from ts-node-dev to tsx for dev, seed, and generate scripts aligns with the past review feedback and should resolve the "exports is not defined" error mentioned earlier.

Also applies to: 22-22, 26-26


12-14: Dotenv initialization and Prisma configuration verified correctly.

Both concerns have been validated:

  • import 'dotenv/config' is properly initialized at the entry point (server.ts:1)
  • Prisma client ^6.17.1 configuration is correct with provider = "prisma-client" and engineType = "client" in the schema

No issues found.

orm/nextjs-graphql/prisma/schema.prisma (1)

1-6: LGTM! Modern Prisma client generator configuration.

The switch to provider = "prisma-client" with engineType = "client" and local output is the recommended ESM-ready configuration for Prisma v6.15+. This aligns with the shift to generated client imports across the codebase.

Based on learnings.

orm/graphql-subscriptions/src/server.ts (3)

1-1: LGTM! Early dotenv initialization.

Loading environment variables via dotenv/config at the top of the entry point ensures they're available before any other imports or configuration.


45-45: LGTM! Fixes the missing body parser issue.

Adding express.json() middleware addresses the "req.body is not set" error mentioned in past comments. The migration to expressMiddleware from @as-integrations/express5 and removal of body-parser is correct for Express v5.


3-3: Review comment verified and confirmed accurate.

The @as-integrations/express5 v1.1.2 package does require Node.js v20 or later, and the package.json confirms both Express 5.1.0 and @as-integrations/express5 ^1.1.2 are present in dependencies. The import statement at line 3 is correct. Ensure your runtime environment meets the Node.js v20+ requirement when deploying this code.

orm/graphql-subscriptions/package.json (1)

20-20: LGTM! Express v5 integration is properly configured.

The addition of @as-integrations/express5 is correctly paired with Express v5.1.0, and the removal of body-parser aligns with the use of built-in express.json() in the server setup.

Also applies to: 25-25

Comment thread orm/graphql-nexus/package.json
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 17, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
orm/nextjs-graphql/lib/pothos-prisma-types.ts (1)

46-46: Extremely long line with embedded JSON.

This 2000+ character line violates typical style guidelines and is difficult to review or debug. If this file is manually maintained, consider:

  • Extracting the JSON to a separate .json file and importing it
  • Using multi-line string formatting
  • Generating this file as part of the build process

If this is already generated code, ensure it's properly documented and excluded from manual edits.

Example refactor (if manually maintained):

import datamodelJSON from './pothos-datamodel.json';

export function getDatamodel(): PothosPrismaDatamodel {
  return datamodelJSON as PothosPrismaDatamodel;
}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 942a506 and fa4ebc8.

📒 Files selected for processing (3)
  • orm/nextjs-graphql/lib/pothos-prisma-types.ts (1 hunks)
  • orm/nextjs-graphql/pages/api/graphql.ts (2 hunks)
  • orm/nextjs-graphql/prisma/schema.prisma (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#8327
File: orm/graphql-auth/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:59.096Z
Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.
📚 Learning: 2025-10-15T13:58:59.096Z
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#8327
File: orm/graphql-auth/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:59.096Z
Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.

Applied to files:

  • orm/nextjs-graphql/prisma/schema.prisma
📚 Learning: 2025-10-15T13:58:29.130Z
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#8327
File: orm/fastify-graphql/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:29.130Z
Learning: In Prisma v6.15 and later, `provider = "prisma-client"` is a valid generator configuration value when combined with `engineType = "client"`. This configuration generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead, and is different from the traditional `provider = "prisma-client-js"` configuration.

Applied to files:

  • orm/nextjs-graphql/prisma/schema.prisma
📚 Learning: 2025-10-15T13:56:01.807Z
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#8327
File: orm/graphql-subscriptions/prisma/schema.prisma:1-5
Timestamp: 2025-10-15T13:56:01.807Z
Learning: In Prisma v6.15 and later, `engineType = "client"` is a valid generator configuration value that generates a Prisma client without Rust engine binaries, relying on JavaScript driver adapters instead (e.g., prisma/adapter-pg). This is useful for edge and serverless deployments.

Applied to files:

  • orm/nextjs-graphql/prisma/schema.prisma
🧬 Code graph analysis (1)
orm/nextjs-graphql/pages/api/graphql.ts (1)
orm/nextjs-graphql/lib/pothos-prisma-types.ts (1)
  • getDatamodel (46-46)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/clerk-nextjs)
  • GitHub Check: test (orm/authjs-nextjs)
  • GitHub Check: test (orm/astro)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/express)
  • GitHub Check: test (orm/fastify)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/koa)
  • GitHub Check: test (orm/hapi)
  • GitHub Check: test (orm/nest)
  • GitHub Check: test (orm/nextjs-trpc)
  • GitHub Check: test (orm/react-router-7)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/sveltekit)
  • GitHub Check: test (orm/solid-start)
  • GitHub Check: test (orm/testing-express)
🔇 Additional comments (6)
orm/nextjs-graphql/prisma/schema.prisma (3)

2-6: Modern Prisma client provider with explicit engineType and output path looks good.

The switch to provider = "prisma-client" (line 2) with engineType = "client" (line 4) aligns with Prisma v6.15+ best practices for ESM-ready clients. The explicit output = "./generated" path and importFileExtension = "ts" are appropriate for this setup.

Based on learnings: The "prisma-client" generator provider is the modern, ESM-ready alternative to "prisma-client-js" and is better suited for contemporary deployments.


8-13: Pothos generator configuration with clientOutput and generateDatamodel looks sound.

The pothos generator updates (lines 8–13) correctly specify the client output path, dedicated output for pothos types, and enable data model generation. These are appropriate for a Pothos-based GraphQL setup.


22-22: Field annotation reordering is a stylistic improvement.

Moving @id before @default(autoincrement()) on the id fields (lines 22 and 30) is a minor stylistic change that aligns with common Prisma conventions and doesn't affect functionality.

Also applies to: 30-30

orm/nextjs-graphql/lib/pothos-prisma-types.ts (2)

13-14: Empty Create and Update types may limit mutation support.

Both User and Post have empty Create: {} and Update: {} types. If this file is generated, this is expected. However, if mutations are needed in the GraphQL API, verify that these types are populated correctly or that mutation input types are defined separately in the schema.

Also applies to: 33-34


1-1: This file is auto-generated by the Pothos Prisma plugin—the ESLint disable is appropriate.

The blanket /* eslint-disable */ on line 1 is correct: this file is generated by the prisma-pothos-types generator configured in schema.prisma and output to orm/nextjs-graphql/lib/pothos-prisma-types.ts. Consider adding a comment above the eslint-disable directive (e.g., // Generated by prisma-pothos-types. Do not edit manually.) for maintainability.

orm/nextjs-graphql/pages/api/graphql.ts (1)

18-19: Good additions to Prisma plugin configuration.

The dmmf: getDatamodel() provides the data model metadata required for Pothos to work with the locally generated Prisma client. The conditional onUnusedQuery configuration is a best practice—warnings in development help identify optimization opportunities, while disabling them in production avoids overhead.

Comment thread orm/nextjs-graphql/pages/api/graphql.ts
Comment thread orm/nextjs-graphql/pages/api/graphql.ts
Comment thread orm/nextjs-graphql/prisma/schema.prisma

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
orm/nextjs-graphql/lib/pothos-prisma-types.ts (1)

46-46: Consider extracting the inline JSON or auto-generating this file.

The massive inline JSON string (1000+ characters) on this line makes the code difficult to read, review, and maintain. Manual synchronization with the Prisma schema is error-prone.

Consider one of these approaches:

  1. Extract the JSON to a separate .json file and import it
  2. Auto-generate this file using a Pothos/Prisma CLI command or script (and document the generation process in a README)
  3. If this file is already auto-generated, add a header comment indicating that and exclude it from manual code review

If auto-generated, apply this diff to add a documentation header:

+/**
+ * AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
+ * Generated by: [command or script name]
+ * To regenerate, run: [command]
+ */
 /* eslint-disable */
orm/nest-graphql-sdl-first/package.json (1)

45-45: Verify @nestjs/config integrates properly with @prisma/extension-accelerate setup.

@nestjs/config version 4.0.2 is appropriate for NestJS 10.4.19. Ensure configuration management (e.g., database URL for Accelerate) is properly wired if using environment-based client configuration.

Check if there is a Prisma service/module that instantiates PrismaClient with the Accelerate extension and uses ConfigService to inject connection details (e.g., DATABASE_URL).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa4ebc8 and 24c1ab2.

📒 Files selected for processing (13)
  • orm/fastify-graphql-sdl-first/package.json (1 hunks)
  • orm/fastify-graphql/package.json (1 hunks)
  • orm/graphql-auth/package.json (1 hunks)
  • orm/graphql-nexus/package.json (2 hunks)
  • orm/graphql-sdl-first/package.json (1 hunks)
  • orm/graphql-subscriptions/package.json (2 hunks)
  • orm/graphql/package.json (2 hunks)
  • orm/hapi-graphql-sdl-first/package.json (1 hunks)
  • orm/hapi-graphql/package.json (1 hunks)
  • orm/nest-graphql-sdl-first/package.json (2 hunks)
  • orm/nest-graphql/package.json (2 hunks)
  • orm/nextjs-graphql/lib/pothos-prisma-types.ts (1 hunks)
  • orm/nextjs-graphql/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • orm/graphql-nexus/package.json
  • orm/fastify-graphql/package.json
  • orm/graphql-auth/package.json
  • orm/nest-graphql/package.json
  • orm/nextjs-graphql/package.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: AmanVarshney01
PR: prisma/prisma-examples#8327
File: orm/graphql-auth/prisma/schema.prisma:2-4
Timestamp: 2025-10-15T13:58:59.096Z
Learning: The "prisma-client" generator provider (introduced in Prisma v6) is the newer, ESM-ready alternative to "prisma-client-js". It requires an explicit output path and is better suited for modern runtimes, edge deployments, and will become the default in Prisma v7. Use "prisma-client" for new projects or when modernizing existing projects.
📚 Learning: 2025-08-22T12:12:24.602Z
Learnt from: FGoessler
PR: prisma/prisma-examples#8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.

Applied to files:

  • orm/graphql-sdl-first/package.json
  • orm/hapi-graphql-sdl-first/package.json
  • orm/nest-graphql-sdl-first/package.json
  • orm/fastify-graphql-sdl-first/package.json
  • orm/hapi-graphql/package.json
  • orm/graphql/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: test (orm/nest-graphql-sdl-first)
  • GitHub Check: test (orm/nest-graphql)
  • GitHub Check: test (orm/betterauth-nextjs)
  • GitHub Check: test (orm/fastify)
  • GitHub Check: test (orm/authjs-nextjs)
  • GitHub Check: test (orm/clerk-nextjs)
  • GitHub Check: test (orm/nextjs-graphql)
  • GitHub Check: test (orm/ai-sdk-nextjs)
  • GitHub Check: test (orm/astro)
  • GitHub Check: test (orm/graphql-auth)
  • GitHub Check: test (orm/express)
  • GitHub Check: test (orm/nextjs)
  • GitHub Check: test (orm/hapi)
  • GitHub Check: test (orm/grpc)
  • GitHub Check: test (orm/nuxt)
  • GitHub Check: test (orm/hono)
  • GitHub Check: test (orm/sveltekit)
  • GitHub Check: test (orm/koa)
  • GitHub Check: test (orm/nextjs-trpc)
  • GitHub Check: test (orm/react-router-7)
  • GitHub Check: test (orm/solid-start)
🔇 Additional comments (12)
orm/hapi-graphql-sdl-first/package.json (1)

6-6: ✓ Migration to tsx resolves ESM compatibility issues.

All changes follow the consistent pattern across the PR: switching from ts-node-dev to tsx for dev/seed runners, upgrading Prisma to ^6.18.0, and adding extension-accelerate and dotenv. This directly addresses the "exports is not defined" error from previous review comments where ts-node-dev couldn't handle ESM-based Prisma clients.

Also applies to: 13-15, 21-22, 26-26

orm/graphql-sdl-first/package.json (1)

4-4: ✓ Consistent with PR pattern; ESM migration maintains GraphQL Yoga compatibility.

The switch to tsx and Prisma ^6.18.0 mirrors the pattern in other example packages. graphql-yoga version is appropriately retained at 5.14.0.

Also applies to: 12-14, 21-22, 26-26

orm/fastify-graphql-sdl-first/package.json (1)

5-5: ✓ Fastify-specific configuration properly adapted.

Changes follow the monorepo migration pattern while maintaining project-specific entry points (tsx src/server). Fastify (5.6.1) and Mercurius (16.2.0) versions are appropriately retained.

Also applies to: 14-16, 24-25, 29-29

orm/hapi-graphql/package.json (1)

6-6: ✓ Resolves generate:nexus script issue; tsx consistently applied.

Line 12 fixes the previous CodeRabbit finding by replacing ts-node with tsx src/schema for the generate:nexus script. Since tsx is now a declared devDependency (line 30), the build workflow is now complete and correct. All other changes align with the monorepo migration pattern.

Also applies to: 12-12, 18-19, 21-21, 29-30, 34-34

orm/graphql-subscriptions/package.json (1)

5-5: ✓ Subscriptions example properly updated; Express v5 integration included.

The addition of @as-integrations/express5 (line 20) reflects the Express v5 migration mentioned in past review comments (fixes req.body middleware issue). All other changes follow the monorepo pattern. WebSocket version (8.18.3) is appropriately pinned for subscription stability.

Also applies to: 11-11, 20-22, 24-24, 37-38, 42-42

orm/graphql/package.json (1)

5-5: ✓ Schema build process updated; Pothos framework compatibility maintained.

Line 9 correctly applies tsx to the build:schema script, consistent with the dev runner pattern. Pothos version specifications (@pothos/core 4.7.0, @pothos/plugin-prisma 4.9.1) are appropriately retained. All changes align with the monorepo migration.

Also applies to: 9-9, 21-23, 30-31, 35-35

orm/nextjs-graphql/lib/pothos-prisma-types.ts (3)

1-1: Verify necessity of disabling all ESLint rules.

Disabling all ESLint rules with /* eslint-disable */ can hide legitimate issues. If this file is manually maintained (not auto-generated), consider either removing this directive or narrowing it to specific rules that need to be disabled.


2-3: LGTM!

The imports correctly reference the locally generated Prisma client at ../prisma/generated/client/client.js with proper ESM .js extensions, aligning with the PR's migration to the newer "prisma-client" generator. Based on learnings.


4-45: The empty Create/Update types do not disable mutations—this is the intended pattern.

The schema uses manual mutation definitions (builder.mutationField()) with custom argument specifications rather than relying on generated Pothos helpers that would use the Create and Update types. All mutations (signupUser, createDraft, publish, deletePost) work correctly and successfully perform database operations. The empty Create: {} and Update: {} in PrismaTypes are part of the auto-generated type structure and are simply unused in this schema design, which is valid.

orm/nest-graphql-sdl-first/package.json (3)

49-49: LGTM: Core dependency upgrades are appropriate.

The Prisma client bump (6.9.0 → 6.18.0) and prisma dev dependency update align with the PR's modernization objectives. Version compatibility with NestJS 10.4.19 looks sound.

Also applies to: 74-74


50-51: Both dependencies are actively used and properly integrated.

The verification confirms:

  • dotenv: Correctly imported with side-effect in src/context.ts via import "dotenv/config";
  • @prisma/extension-accelerate: Imported and applied to PrismaClient in both src/context.ts and prisma/seed.ts via withAccelerate()

The dependencies are required for Prisma Postgres database connectivity, as documented in the README.


79-79: Add import 'dotenv/config'; to the top of prisma/seed.ts.

The seed.ts file exists but lacks the dotenv side-effect import. When prisma db seed executes, seed.ts runs in isolation without access to environment variables unless explicitly imported. Add import 'dotenv/config'; as the first line to ensure DATABASE_URL and other env vars are loaded.

Current seed.ts starts with:

import { PrismaClient, Prisma } from './generated/client';

Should be:

import 'dotenv/config';
import { PrismaClient, Prisma } from './generated/client';
⛔ Skipped due to learnings
Learnt from: FGoessler
PR: prisma/prisma-examples#8260
File: generator-prisma-client/nextjs-starter-webpack-turborepo/packages/database/package.json:13-13
Timestamp: 2025-08-22T12:12:24.602Z
Learning: When analyzing changes from package.json seed scripts to "prisma db seed", always verify the actual content of prisma.config.ts rather than relying solely on regex patterns, as the configuration may be properly defined but in a format that doesn't match overly restrictive search patterns.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 25, 2025
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 27, 2025
@AmanVarshney01
AmanVarshney01 merged commit 1d0d39e into latest Oct 27, 2025
45 of 46 checks passed
@AmanVarshney01
AmanVarshney01 deleted the update-graphql-examples branch October 27, 2025 11:41
aidankmcalister pushed a commit that referenced this pull request Oct 27, 2025
aidankmcalister added a commit that referenced this pull request Oct 28, 2025
* project added

* readme's updated

* test added

* minor changes

* typo

* update graphql test

* update test

* another grapql udapte

* revert graphql tests

* Update GraphQL examples (#8327)

* fix(deps): pin dependencies (#8335)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency supertest to v7.1.4 (#8234)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

---------

Co-authored-by: Aman Varshney <amanvarshney.work@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@coderabbitai coderabbitai Bot mentioned this pull request Dec 13, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Jan 7, 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.

3 participants