Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible collision with prisma extensions #302

Open
2 tasks done
imsherrill opened this issue Apr 15, 2024 · 1 comment
Open
2 tasks done

possible collision with prisma extensions #302

imsherrill opened this issue Apr 15, 2024 · 1 comment

Comments

@imsherrill
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Versions

"prisma": "^4.12.0",
"prisma-json-types-generator": "3.0.4"

A minimal reproducible example

none

Description

My understanding is that the generator is supposed to go into the generated .d.ts file and find the field and replace the field's Prisma.JsonValue type with what I've provided and added to global names (in this case let's say it's CustomJsonType)

and it works in some cases for example:

  export type ProposalGroupByOutputType = {
    id: string
    ...
    jfield: PrismaJson.CustomJsonType
    ...
  }

but seems like in other cases its missing the default types and I think its because its already overloaded the type (instead of proposal its given Extension.GetResults)

export type ProposalPayload<ExtArgs extends $Extensions.Args = $Extensions.DefaultArgs> = {
  name: "Proposal"
  objects: {
    company: CompanyPayload<ExtArgs>
    ...
  }
  scalars: $Extensions.GetResult<{
    id: string
    ...
    /**
     * [CustomJsonType]
     */
    jfield: Prisma.JsonValue
  }, ExtArgs["result"]["proposal"]>
  composites: {}
}

I know it works by using prisma's abstract syntax tree so instead of replacing the type it seems like its leaving the comment there that informs what should be swapped out for the Prisma.JsonValue

is this a bug/ collision with extensions or am I misunderstanding whats going on here?

Steps to Reproduce

setup a simple prisma extension and try to use json prisma-json-types-generator

Expected Behavior

No response

@arthurfiorette
Copy link
Owner

Can you set up a minimal reproducible example?

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

No branches or pull requests

2 participants