Skip to content

Conversation

ahmedhosnypro
Copy link

@ahmedhosnypro ahmedhosnypro commented Sep 28, 2025

…g changes

🚀 Major Features & Breaking Changes

Bytes Type Migration to Uint8Array

To align with Prisma v6, the Bytes scalar type is now mapped to Uint8Array instead of Buffer. A custom GraphQL BytesScalar has been introduced to handle serialization and is now conditionally generated and imported only when a schema utilizes the Bytes type.


Updated fullTextSearch Preview Feature

The preview feature flag for full-text search on PostgreSQL has been updated from fullTextSearch to the new provider-specific fullTextSearchPostgres.


Consistent find...OrThrow API

The generator now maps findFirstOrThrow to findFirstOrThrow{ModelName}, creating a more consistent and predictable API for throw-on-not-found queries.

Reserved Model Name Prevention


New Types and Arguments

Support has been added for the new ScalarRelationFilter input type.

Generated types now include the limit argument for applicable find queries.

New output types have been added for updateMany operations.


🛠️ Fixes & Refinements

The FieldDefault arguments type has been refined to Array<string | number> to match Prisma's updated type definitions.

Corrected the parsing of input type names that include ScalarRelationFilter.

Removed unnecessary type assertions and unused imports to improve code quality.


Othe BREAKING CHANGE: This fix alters the code generator's output, introducing the following breaking changes.

  • Removal of Generated Files: The generator no longer creates obsolete filter files (e.g., FirstModelRelationFilter.ts). Any code that imports these files will now fail.

    • Why: The fix aligns the generator with Prisma's modern data model, which uses a new ScalarRelationFilter structure, making the old files redundant.
  • New Filter Type API: The old filter types are replaced by the new ScalarRelationFilter types. This changes the names, structure, and available properties of the filter objects.

    • Why: Code must be migrated to use the new, correctly generated API. Existing logic that constructs or uses the old filter types is no longer valid and must be refactored.

⚙️ Dependencies & Tooling

Prisma dependencies have been updated to v6.16.2.

Jest and TypeScript configurations were updated to use CommonJS and support NodeNext module resolution for better compatibility.

The pre-commit hook was fixed to correctly run tests using npx lint-staged.


✅ Testing

Added new regression tests to verify the correct handling of the Bytes scalar and the new error-throwing behavior in Prisma v6.

Updated numerous tests and Jest snapshots to align with the extensive changes in the generated code, including new arguments, updated import paths, and revised type structures.

…g changes

🚀 Major Features & Breaking Changes

Bytes Type Migration to Uint8Array

To align with Prisma v6, the Bytes scalar type is now mapped to Uint8Array instead of Buffer. A custom GraphQL BytesScalar has been introduced to handle serialization and is now conditionally generated and imported only when a schema utilizes the Bytes type.

Updated fullTextSearch Preview Feature

The preview feature flag for full-text search on PostgreSQL has been updated from fullTextSearch to the new provider-specific fullTextSearchPostgres.

Consistent find...OrThrow API

The generator now maps findFirstOrThrow to getFirst{ModelName}, creating a more consistent and predictable API for throw-on-not-found queries.

Reserved Model Name Prevention

The generator now prevents the use of new reserved keywords (async, await, using) as model names to avoid conflicts.

New Types and Arguments

Support has been added for the new ScalarRelationFilter input type.

Generated types now include the limit argument for applicable find queries.

New output types have been added for updateMany operations.

🛠️ Fixes & Refinements

The FieldDefault arguments type has been refined to Array<string | number> to match Prisma's updated type definitions.

Corrected the parsing of input type names that include ScalarRelationFilter.

Removed unnecessary type assertions and unused imports to improve code quality.

⚙️ Dependencies & Tooling

Prisma dependencies have been updated to v6.16.2.

Jest and TypeScript configurations were updated to use CommonJS and support NodeNext module resolution for better compatibility.

The pre-commit hook was fixed to correctly run tests using npx lint-staged.

✅ Testing

Added new regression tests to verify the correct handling of the Bytes scalar and the new error-throwing behavior in Prisma v6.

Updated numerous tests and Jest snapshots to align with the extensive changes in the generated code, including new arguments, updated import paths, and revised type structures.
@ahmedhosnypro
Copy link
Author

ahmedhosnypro commented Sep 28, 2025

(please add following before mergin for build)

for successful build (my env: node:24) , I updated dependancies and add some required ones for prisma,

  "peerDependencies": {
    "@prisma/client": "^6.16.2",
    "@types/graphql-fields": "^1.3.9",
    "@types/node": "*",
    "graphql-fields": "^2.0.3",
    "graphql-scalars": "^1.23.0",
    "prisma": "^6.16.2",
    "tslib": "^2.6.3",
    "type-graphql": "^1.1.1 || >=1.2.0-rc || >=2.0.0-beta || >=2.0.0-rc"
  },
  "dependencies": {
    "@opentelemetry/api": "^1.9.0",
    "@prisma/generator-helper": "^6.16.2",
    "@prisma/internals": "^6.16.2",
    "fp-ts": "^2.16.11",
    "fs-jetpack": "^5.1.0",
    "http-proxy-agent": "^7.0.2",
    "https-proxy-agent": "^7.0.6",
    "pluralize": "^8.0.0",
    "resolve": "^1.22.10",
    "semver": "^7.7.2",
    "ts-morph": "^27.0.0",
    "tslib": "^2.6.3"
  },
  "devDependencies": {
    "@jest/types": "^30.0.5",
    "@prisma/client": "^6.16.2",
    "@prisma/generator": "^6.16.2",
    "@types/graphql-fields": "^1.3.9",
    "@types/jest": "^30.0.0",
    "@types/node": "^24.5.2",
    "@types/pg": "^8.15.5",
    "@types/pluralize": "0.0.33",
    "@types/resolve": "^1.20.6",
    "@types/semver": "^7.7.1",
    "@types/validator": "^13.15.3",
    "directory-tree": "^3.5.2",
    "env-cmd": "^11.0.0",
    "graphql": "^16.11.0",
    "graphql-fields": "^2.0.3",
    "graphql-scalars": "^1.24.2",
    "husky": "^9.1.7",
    "jest": "^30.1.3",
    "lint-staged": "^16.2.1",
    "pg": "^8.16.3",
    "prettier": "^3.6.2",
    "prettier-2": "npm:prettier@^3.6.2",
    "prisma": "^6.16.2",
    "reflect-metadata": "0.2.2",
    "ts-jest": "~29.4.4",
    "ts-node": "^10.9.2",
    "ts-toolbelt": "^9.6.0",
    "tslib": "^2.8.1",
    "type-graphql": "2.0.0-rc.2",
    "typescript": "~5.9.2"
  },

@MichalLytek MichalLytek self-requested a review October 6, 2025 07:34
@MichalLytek MichalLytek added enhancement New feature or request community Something initiated by the community labels Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Something initiated by the community enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants