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
Prisma 4.8 produces conflicting typescript types for custom many to many relations #17005
Comments
I can confirm this issue happens with |
This looks related to #16844 @SevInf Released in our internal version
/**
* PostMedia without action
*/
export type PostMediaArgs = {
/**
* Select specific fields to fetch from the PostMedia
*
**/
select?: PostMediaSelect | null
/**
* Choose, which related nodes to fetch as well.
*
**/
include?: PostMediaInclude | null
} and since // line 1907
/**
* Post.media
*/
export type PostMediaArgs = {
/**
* Select specific fields to fetch from the PostMedia
*
**/
select?: PostMediaSelect | null
/**
* Choose, which related nodes to fetch as well.
*
**/
include?: PostMediaInclude | null
where?: PostMediaWhereInput
orderBy?: Enumerable<PostMediaOrderByWithRelationInput>
cursor?: PostMediaWhereUniqueInput
take?: number
skip?: number
distinct?: Enumerable<PostMediaScalarFieldEnum>
}
// line 3967
/**
* PostMedia without action
*/
export type PostMediaArgs = {
/**
* Select specific fields to fetch from the PostMedia
*
**/
select?: PostMediaSelect | null
/**
* Choose, which related nodes to fetch as well.
*
**/
include?: PostMediaInclude | null
} |
Since 4.8.0, we generate explicit types for model fields args, not only for top level queries. Naming we choose for it, `ModelFieldArgs` can clash with existing types if `ModelField` type also exists in the schema. To fix it, this PR changes naming scheme to `Model$fieldArgs`. Since `$` can not be used in type name, this new naming scheme is guaranteed not to clash with anything. Fix #17005
Since 4.8.0, we generate explicit types for model fields args, not only for top level queries. Naming we choose for it, `ModelFieldArgs` can clash with existing types if `ModelField` type also exists in the schema. To fix it, this PR changes naming scheme to `Model$fieldArgs`. Since `$` can not be used in type name, this new naming scheme is guaranteed not to clash with anything. Fix #17005
Since 4.8.0, we generate explicit types for model fields args, not only for top level queries. Naming we choose for it, `ModelFieldArgs` can clash with existing types if `ModelField` type also exists in the schema. To fix it, this PR changes naming scheme to `Model$fieldArgs`. Since `$` can not be used in type name, this new naming scheme is guaranteed not to clash with anything. Fix #17005
for top level queries. Naming we choose for it, `ModelFieldArgs` can clash with existing types if `ModelField` type also exists in the schema. To fix it, this PR changes naming scheme to `Model$fieldArgs`. Since `$` can not be used in type name, this new naming scheme is guaranteed not to clash with anything. Fix #17005 Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com> Co-authored-by: Daniel Starns <danielstarns@hotmail.com>
Since 4.8.0, we generate explicit types for model fields args, not only for top level queries. Naming we choose for it, `ModelFieldArgs` can clash with existing types if `ModelField` type also exists in the schema. To fix it, this PR changes naming scheme to `Model$fieldArgs`. Since `$` can not be used in type name, this new naming scheme is guaranteed not to clash with anything. Fix #17005 Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com> Co-authored-by: Daniel Starns <danielstarns@hotmail.com>
…ly (#17101) for top level queries. Naming we choose for it, `ModelFieldArgs` can clash with existing types if `ModelField` type also exists in the schema. To fix it, this PR changes naming scheme to `Model$fieldArgs`. Since `$` can not be used in type name, this new naming scheme is guaranteed not to clash with anything. Fix #17005 Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com> Co-authored-by: Daniel Starns <danielstarns@hotmail.com>
Note: fix will be published as 4.8.1 version today |
Is this only for explicit relations or for implicit ones as well? |
…ly (#17101) for top level queries. Naming we choose for it, `ModelFieldArgs` can clash with existing types if `ModelField` type also exists in the schema. To fix it, this PR changes naming scheme to `Model$fieldArgs`. Since `$` can not be used in type name, this new naming scheme is guaranteed not to clash with anything. Fix #17005 Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com> Co-authored-by: Daniel Starns <danielstarns@hotmail.com>
Hi, can we reopen this issue, or should I open a new one? I'm getting the same error on prisma v4.16.2, but with a different schema definition. Node version: v16.19.1 Prisma version:
|
@HugoxSaraiva I took a look at your repository and this specific issue have been fixed in 5.1, I'd suggest updating. Generally speaking, the chance that the issue you are experiencing is exactly the same as the one that was fixed 7 month ago are pretty low, even if the error message seems similar. So, I'd always advice to check latest Prisma version first and if you still have the problem then open a new issue, please. |
Bug description
prisma 4.8 is producing multiple typescript type definitions with the same name for a fairly common naming pattern for a custom many to many relation
How to reproduce
Expected behavior
Type checking the client should not cause errors, types should all have unique names
Prisma information
// Add your code using Prisma Client
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: