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

Prisma 5 released - breaks generated types #177

Closed
jasonmacdonald opened this issue Jul 12, 2023 · 19 comments
Closed

Prisma 5 released - breaks generated types #177

jasonmacdonald opened this issue Jul 12, 2023 · 19 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed released on @next released

Comments

@jasonmacdonald
Copy link

It looks like the changes introduced in V5 of Prisma break the generated files from this. Lots of * is not assignable to type * type errors. I guess it's because of the changes to carry shortcuts, but it might be something else. I've tried searching through, but I got in a bit of looping trying to find the exact reason.

https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-5#removal-of-array-shortcuts

@jasonmacdonald
Copy link
Author

jasonmacdonald commented Jul 12, 2023

It looks like they are now wrapping certain types in a Prisma.AtLeast<{...classProps}, "prop1" | "prop1"> function which makes certain properties required if they are, I assume, @id, @@id or @unique in the schema.

EDIT: Narrowed it down to any WhereUniqueInput class. they are all wrapped in this condition now.

@magrinj
Copy link

magrinj commented Jul 21, 2023

I'm trying to fix it, note sure if that's enough but maybe doing something like that in input-type.ts will fix the issue:

    const isWhereUniqueInput = inputType.name.endsWith('WhereUniqueInput');
    const modelField = model?.fields.find(f => f.name === name);
    const isCustomsApplicable = typeName === modelField?.type;
    const isId = modelField?.isId; // Extract if it's an id
    const isUnique = modelField?.isUnique; // Extract if it's unique
    const hasDefaultValue = modelField?.hasDefaultValue; // Extract if it has default value
    // Create a new nullable condition based on the values
    const isNullable = !((isId && hasDefaultValue) || (isId && isWhereUniqueInput) || isUnique || isRequired);
    const propertyType = castArray(
      propertySettings?.name ||
        getPropertyType({
          location,
          type: typeName,
        }),
    );
    const property = propertyStructure({
      name,
      isNullable,
      propertyType,
      isList,
    });

Is it the correct way to go @unlight ?

@magrinj
Copy link

magrinj commented Jul 21, 2023

@unlight I make a PR, hope it's the correct way to fix it

@unlight
Copy link
Owner

unlight commented Jul 24, 2023

@jasonmacdonald @magrinj @Siumauricio
Please check version 19 (use next dist-tag) with prisma 5

npm i prisma-nestjs-graphql@next

@magrinj
Copy link

magrinj commented Jul 25, 2023

Hi @unlight, thanks a lot, I will take a look today :)
Didn't had time to fix tests issues yesterday, but it seems you fix them

@garysb
Copy link

garysb commented Jul 27, 2023

Can confirm that v19.0.0 works as expected.

@unlight unlight closed this as completed Jul 29, 2023
@jasonmacdonald
Copy link
Author

jasonmacdonald commented Aug 3, 2023

@unlight Unfortunately, I'm still getting errors in any WHere class with an AND etc., as they are self-references and, therefore, not wrapped with the Prisma.AtLeast. So we need to also add it to those.

export declare class SomeClassWhereUniqueInput {
    AND?: Array<SomeClassWhereUniqueInput>;
    OR?: Array<SomeClassWhereUniqueInput>;
    NOT?: Array<SomeClassWhereUniqueInput>;
}

I think the issue is that we are wrapping the where: Prisma.AtLeast<SomeCLasseUniqueInput, 'id'>; instead of the actual type like Prisma does.

 export type SomeClassWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: SomeClassWhereUniqueInput | SomeClassWhereUniqueInput[]
    OR?: SomeClassWhereUniqueInput[]
    NOT?: SomeClassWhereUniqueInput | SomeClassWhereUniqueInput[]
    ...
}

@unlight
Copy link
Owner

unlight commented Aug 5, 2023

@jasonmacdonald
Please provide example schema, how can I reproduce it.

@unlight unlight reopened this Aug 5, 2023
@ysuhaas
Copy link

ysuhaas commented Sep 6, 2023

@jasonmacdonald Curious if you ended up finding a workaround here? We are seeing the same issue in our project as well

@jasonmacdonald
Copy link
Author

@jasonmacdonald Curious if you ended up finding a workaround here? We are seeing the same issue in our project as well

We held off upgrading due to some other reasons, but this issue still exists for us as well. I haven't had a chance to dig deeper though.

@bigfree
Copy link

bigfree commented Sep 8, 2023

I have same problem. Installed prisma-nestjs-graphql@next version.

findOne(userWhereUniqueInput: UserWhereUniqueInput) {
    return this.prisma.user.findUnique({
        where: userWhereUniqueInput,
    }) as Promise<User>;
}

Here is type error:

Type 'UserWhereUniqueInput' is not assignable to type '{ id: string; email: string; } & { id?: string | undefined; email?: string | undefined; AND?: UserWhereInput | UserWhereInput[] | undefined; OR?: UserWhereInput[] | undefined; NOT?: UserWhereInput | ... 1 more ... | undefined; password?: string | ... 1 more ... | undefined; createdAt?: string | ... 3 more ... | unde...'.
Type  UserWhereUniqueInput  is not assignable to type  { id: string; email: string; } 
Types of property  id  are incompatible.
Type  string | undefined  is not assignable to type  string 
Type  undefined  is not assignable to type  string 
index.d.ts(1471, 5): The expected type comes from property  where  which is declared here on type

Prisma model

model User {
  /// @HideField({ match: 'User*@(Create|Update)*Input' })
  id        String    @id @default(cuid())
  email     String    @unique @db.VarChar(255)
  password  String
  /// @HideField({ output: false, input: true })
  createdAt DateTime? @default(now())
  /// @HideField({ output: false, input: true })
  updatedAt DateTime? @updatedAt
}

Here is generate prisma UserWhereUniqueInput

export type UserWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    email?: string
    AND?: UserWhereInput | UserWhereInput[]
    OR?: UserWhereInput[]
    NOT?: UserWhereInput | UserWhereInput[]
    password?: StringFilter<"User"> | string
    createdAt?: DateTimeNullableFilter<"User"> | Date | string | null
    updatedAt?: DateTimeNullableFilter<"User"> | Date | string | null
}, "id" | "email">

And here prisma-nestjs-graphql UserWhereUniqueInput

import { Field } from '@nestjs/graphql';
import { InputType } from '@nestjs/graphql';
import { UserWhereInput } from './user-where.input';
import { StringFilter } from '../prisma/string-filter.input';
import { DateTimeNullableFilter } from '../prisma/date-time-nullable-filter.input';
import { HideField } from '@nestjs/graphql';

@InputType()
export class UserWhereUniqueInput {

    @Field(() => String, {nullable:true})
    id?: string;

    @Field(() => String, {nullable:true})
    email?: string;

    @Field(() => [UserWhereInput], {nullable:true})
    AND?: Array<UserWhereInput>;

    @Field(() => [UserWhereInput], {nullable:true})
    OR?: Array<UserWhereInput>;

    @Field(() => [UserWhereInput], {nullable:true})
    NOT?: Array<UserWhereInput>;

    @Field(() => StringFilter, {nullable:true})
    password?: StringFilter;

    @HideField()
    createdAt?: DateTimeNullableFilter;

    @HideField()
    updatedAt?: DateTimeNullableFilter;
}

any idea?

@unlight
Copy link
Owner

unlight commented Sep 16, 2023

@bigfree Thank you for example.

Yes, UserWhereUniqueInput and Prisma.AtLeast<UserWhereUniqueInput,...> are incompatible
But GraphQL doesnt have 'oneOf' feature (e.g. https://gatographql.com/guides/augment/oneof-input-object/)

From my POV, generated class is valid, I do not see how it can be fixed in terms of compatibility.
So, I think you should add additional validation logic to your method.

For example:

findOne(userWhereUniqueInput: UserWhereUniqueInput) {
    // Validate that userWhereUniqueInput has id, email other unique key
    const validatedUserWhereUniqueInput = userWhereUniqueInput as Prisma.AtLeast<UserWhereUniqueInput, ...>;
    return this.prisma.user.findUnique({ where: validatedUserWhereUniqueInput });
}
  // Pseudo code
  @UsePipes(new ValidateAtLeastIdOrEmail())
  findOne(userWhereUniqueInput: Prisma.AtLeast<UserWhereUniqueInput, 'id' | 'email'>) {
    $prisma.user.findUnique({ where: userWhereUniqueInput }); // OK
  }
const userWhereUniqueInput: UserWhereUniqueInput = {}; // ERROR

$prisma.user.findUnique({ where: userWhereUniqueInput }); // OK
$prisma.user.findUnique({ where: userWhereUniqueInput as Prisma.AtLeast<UserWhereUniqueInput, 'id' | 'email'> }); // OK

Maybe I may add additional metadata to such classes.

@InputType()
export class UserWhereUniqueInput {
  @Field(() => String, { nullable: true })
  @Reflect.metadata('AtLeast')
  id?: string;

  @Field(() => Scalars.GraphQLEmailAddress, { nullable: true })
  @Reflect.metadata('AtLeast')
  email?: string;
}

Validator can be created
These metadata can be parsed by custom pipe validator, but it will not fix compatibility in typescript.

@unlight unlight added the help wanted Extra attention is needed label Sep 16, 2023
@unlight
Copy link
Owner

unlight commented Sep 16, 2023

Another idea - introduce new option in config to trick typescript and add exclamation mark for all unique fields for such WhereUniqueInput classes (unsafe, needs validation and coercing to valid type).

@InputType()
export class UserWhereUniqueInput {
  @Field(() => String, { nullable: true })
  id!: string;

  @Field(() => Scalars.GraphQLEmailAddress, { nullable: true })
  email!: string;
}

@unlight unlight added enhancement New feature or request and removed enhancement New feature or request labels Sep 16, 2023
@isaacpz
Copy link

isaacpz commented Sep 19, 2023

Another idea - introduce new option in config to trick typescript and add exclamation mark for all unique fields for such WhereUniqueInput classes (unsafe, needs validation and coercing to valid type).

If helpful, I think we'd choose this solution! Maybe this should be hidden behind some configuration flag since it sacrifices some type safety though?

@bigfree
Copy link

bigfree commented Sep 19, 2023

@unlight Thx for you response. I'll try type assertion, but it's a bit messy in the code. I'm in for a switch in the configuration even if it is a bit unsafe.

@unlight unlight self-assigned this Sep 19, 2023
@unlight unlight added the enhancement New feature or request label Sep 19, 2023
@jasonmacdonald
Copy link
Author

@unlight Unfortunately, I'm still getting errors in any WHere class with an AND etc., as they are self-references and, therefore, not wrapped with the Prisma.AtLeast. So we need to also add it to those.

export declare class SomeClassWhereUniqueInput {
    AND?: Array<SomeClassWhereUniqueInput>;
    OR?: Array<SomeClassWhereUniqueInput>;
    NOT?: Array<SomeClassWhereUniqueInput>;
}

I think the issue is that we are wrapping the where: Prisma.AtLeast<SomeCLasseUniqueInput, 'id'>; instead of the actual type like Prisma does.

 export type SomeClassWhereUniqueInput = Prisma.AtLeast<{
    id?: string
    AND?: SomeClassWhereUniqueInput | SomeClassWhereUniqueInput[]
    OR?: SomeClassWhereUniqueInput[]
    NOT?: SomeClassWhereUniqueInput | SomeClassWhereUniqueInput[]
    ...
}

@unlight update on the issue I posted a while back. I finally had time to look deeper into the matter; a custom InputType in our code was the cause. We had created one that was not using AtLeast properly when including a unique input created by this library. It was tricky to hunt down due to the overly verbose nested typescript errors. Once I fixed the aforementioned input, everything worked as expected. Sorry for the false alarm.

@ysuhaas, if you are still getting a similar issue, try checking any custom InputType or ObjectTypes you have.

unlight added a commit that referenced this issue Sep 23, 2023
github-actions bot pushed a commit that referenced this issue Sep 23, 2023
## [19.2.0](v19.1.0...v19.2.0) (2023-09-23)

### Features

* **compatibility:** New configuration option `unsafeCompatibleWhereUniqueInput` ([72a3dab](72a3dab)), closes [#177](#177)
@github-actions
Copy link

🎉 This issue has been resolved in version 19.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This issue has been resolved in version 19.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@simonjoom
Copy link

simonjoom commented Mar 18, 2024

I got the same problem using last type-graphql and typegraphql-prisma generator

for me to resolve what i did:
when the class got only one @unique field id in his model, change the ? to the exclamation class

@InputType()
export class UserWhereUniqueInput {
  @Field(() => String, { nullable: true })
  id!: string;

  @Field(() => String, { nullable: true })
  fieldoptional?: string;
}

but if there is atleast 2 unique in the model

you will need to change all relations in type-graphql/resolvers/** files generated code :
(here for a model user with unique type are id and email)
where!: UserWhereUniqueInput;
to
where!: Prisma.AtLeast<UserWhereUniqueInput, 'id' | 'email'>;
and also for relation connect
(here with model Country with unique type are id and name)
connect?: CountryWhereUniqueInput | undefined;
to change :
connect?: Prisma.AtLeast<CountryWhereUniqueInput,"id"|"name"> | undefined;

I think this way is the more clean one and should to work for both in runtime and typings.

Seems the last code prisma-nestjs-graphql fix that, but would be great that the generator
https://github.com/MichalLytek/typegraphql-prisma do that by default i think

github-actions bot pushed a commit to resident-advisor/prisma-nestjs-graphql that referenced this issue Mar 20, 2024
## 1.0.0 (2024-03-20)

### ⚠ BREAKING CHANGES

* Bump version
* Update packages
* Require `@prisma/client` v4.12+
Must be used with optional dependency `prisma-graphql-type-decimal` v3.0.0+
* Update library to support to Prisma v4
* @type decorator will be added to all input classes
* **other:** defaults `input` and `output` in PropertyType to false
* Configuration `useInputType` changed underlying library for pattern matching
https://github.com/axtgr/outmatch, prefix renamed to `match:`
* Removed deprecated setting `types_*`
* Model is regenerating ignoring existing data, any manual changes will be discarded
* Enum is regerating now, any manual changes will be discarded
* **compatibility:** Possible breaking change aggregation keywords use underscore as prefix to prevent field clashes
* Adapted to Prisma 2.20
* Renamed token `{feature}` to `{model}` in `outputFilePattern` template pattern
* Removed `renameZooTypes` config option
* Config option `combineScalarFilters` is false by default
* Made all options which mutates/renames types are `false`
* Inverted config option `atomicNumberOperations` to `noAtomicNumberOperations`
Replace `atomicNumberOperations = false` by `noAtomicNumberOperations = true`
* Adapt generator to Prisma 2.16
* Typescript property type now same as graphql type
* Generated types tries to be compatible with Prisma types,
nullability (optional/required) changed for input types
* **prisma:** Adapt generator to Prisma v2.13
* Switched to replace mode generation of files, all extra field which are not exists in model will be
removed
* Generator options: dasherizedName renamed to name
* Adapted to prisma 2.12
* Adapted generator to Prisma 2.8

### Features

* @PropertyType() to replace types_ configuration ([4a7313d](4a7313d))
* `useInputType` config option allow to choose input type ([54eeb1c](54eeb1c))
* Ability to hide field in schema ([a222955](a222955)), closes [unlight#8](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/8)
* Adapted generator to Prisma 2.14 ([26a23c4](26a23c4))
* Adapted generator to Prisma 2.15 ([77b87a6](77b87a6))
* Add options to generate only selected blocks ([cabe9bd](cabe9bd))
* add the prisma client import option ([00c81d5](00c81d5))
* Allow add deprecation reason ([432e8f1](432e8f1)), closes [unlight#104](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/104)
* Allow generate compiled files or merged to single file ([095f975](095f975)), closes [unlight#15](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/15)
* Allow hide property using decorate in config ([b83beeb](b83beeb))
* Allow the use of the generate function without the `onGenerate` ([a566cca](a566cca)), closes [unlight#168](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/168) [unlight#169](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/169)
* Allow to configure path to `tsconfig.json` ([ead4411](ead4411))
* Alternative default import configuration ([4ae1b82](4ae1b82))
* Apply custom decorators on models ([34196b3](34196b3))
* Combine zoo of nested/nullable filters ([20f965b](20f965b))
* **compatibility:** New configuration option `unsafeCompatibleWhereUniqueInput` ([72a3dab](72a3dab)), closes [unlight#177](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/177)
* **configuration:** Allow purge output folder ([a360869](a360869)), closes [unlight#7](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/7)
* **configuration:** Allow to map prisma scalars to custom graphql scalars ([59300e1](59300e1)), closes [unlight#87](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/87)
* **configuration:** Option to disable ID graphql type ([8474da7](8474da7)), closes [unlight#44](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/44)
* Custom decorators ([b14f0fe](b14f0fe))
* **custom decorators:** Abstract and rename type ([eb68ca6](eb68ca6)), closes [unlight#40](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/40)
* **custom decorators:** Allow apply custom decorator on models ([52f090a](52f090a)), closes [unlight#63](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/63)
* **custom decorators:** Allow attach `@Directive()` ([d6faef0](d6faef0))
* **custom decorators:** New `decorate` generator setting ([c5e14b7](c5e14b7)), closes [unlight#48](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/48)
* **custom decorators:** New `decorate` generator setting ([db970f0](db970f0)), closes [unlight#48](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/48)
* Custom graphql field mapping ([10fb039](10fb039))
* Custom property mapping ([f8cc54d](f8cc54d))
* Duplicate comments in jsdoc ([002a055](002a055)), closes [unlight#39](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/39)
* Export all classes from one file ([92ca651](92ca651)), closes [unlight#5](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/5)
* Extend `reExport` option ([3d5475b](3d5475b))
* First release ([340a105](340a105))
* Generate aggregate input types ([66239bb](66239bb))
* Generate args types ([5015de7](5015de7))
* Generate commented class if re-export found ([dc3e268](dc3e268))
* Generate JSON scalar type ([82007d7](82007d7))
* Generate other output types ([55e5cd5](55e5cd5))
* **hide field:** Allow hide field in type matching by pattern ([6c05123](6c05123)), closes [unlight#37](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/37)
* **match:** Allows `match` expressions in `FieldType` and `PropertyType` ([unlight#60](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/60)) ([a9b0e46](a9b0e46))
* New option rename zoo types ([04cb5af](04cb5af))
* New token `{plural.type}` for outputFilePattern generator options ([51cc938](51cc938))
* Option to disable atomic number operations ([3319ff9](3319ff9))
* **require single uniq filter:** New `requireSingleFieldsInWhereUniqueInput` generator setting ([7ee73eb](7ee73eb)), closes [unlight#58](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/58)
* Skip write stage for files with no changes ([ecc2fb8](ecc2fb8))
* Support reexport with custom output pattern ([2786894](2786894))
* Use Prisma.Decimal typescript type ([0395e5f](0395e5f))
* Validate `outputFilePattern` ([3240a73](3240a73))

### Bug Fixes

* `tsConfigFilePath` is ignored ([d98e146](d98e146)), closes [unlight#88](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/88)
* Adapt new native types ([f1ba6bc](f1ba6bc))
* Adapted generator to Prisma 2.8 ([4ac4779](4ac4779))
* Adapted to prisma 2.12 ([7e0ab3f](7e0ab3f))
* Adapted to Prisma 2.20 ([c5f040d](c5f040d)), closes [unlight#17](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/17)
* Added more keywords for detection model name ([51c836e](51c836e))
* Added new feature split keywords ([e780043](e780043))
* AwaitEventEmitter is not a constructor ([6f97126](6f97126)), closes [unlight#200](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/200)
* BigInt property type in lower ([19ace4e](19ace4e))
* Combine scalar filters on nullable list ([8f306e8](8f306e8))
* Combine scalar filters with `fieldReference` ([1f1ef9c](1f1ef9c)), closes [unlight#148](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/148)
* Combine scalars option with nullable relation filter ([471c405](471c405))
* **combine scalars:** Bytes filter ([6b0a156](6b0a156))
* Compatibility Issues with Prisma 5 ([1e1bee3](1e1bee3)), closes [unlight#179](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/179)
* **compatibility:** Add typescript null type for optional fields in model ([df0b9de](df0b9de)), closes [unlight#57](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/57)
* **compatibility:** Make model types compatible from both sides Prisma and GraphQL ([c015f12](c015f12)), closes [unlight#41](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/41)
* **compatibility:** Rename aggregation keywords ([83491c8](83491c8))
* Compound primary key generated type ([64a9854](64a9854)), closes [unlight#182](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/182)
* Conflict with models ending with `Output` ([a08d4c4](a08d4c4)), closes [unlight#10](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/10)
* Corrected scalar property type for where type ([b9e5937](b9e5937))
* Create bin script ([a6c2573](a6c2573)), closes [unlight#92](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/92)
* Create decimal value object ([f368231](f368231)), closes [unlight#113](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/113)
* **custom decorators:** `FieldType` respect input/output in generator settings ([a075e00](a075e00)), closes [unlight#34](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/34)
* **custom decorators:** FieldType mapping for output types ([c036a10](c036a10)), closes [unlight#55](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/55)
* **custom decorators:** Missed imports when enabled `emitSingle` ([bf55996](bf55996)), closes [unlight#28](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/28)
* **custom decorators:** Prevent applying on aggregate inputs ([9b21970](9b21970))
* **custom decorators:** Reget decorator full name ([9e279bf](9e279bf)), closes [unlight#29](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/29)
* Custom field types array ([ead56a4](ead56a4))
* Custom type for output types ([c9ae9e9](c9ae9e9))
* Decorate parent decimal inputs ([9a7da40](9a7da40)), closes [unlight#113](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/113)
* Deprecation warnings ([55b21fd](55b21fd)), closes [unlight#161](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/161)
* Detect graphql type ([89a59cc](89a59cc)), closes [unlight#148](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/148)
* Detection property nullable type ([2121885](2121885))
* Do not generate undefined properties ([c7127a4](c7127a4))
* Dummy bump ([a161650](a161650))
* Duplicate import ([2a18c19](2a18c19)), closes [unlight#18](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/18)
* Emit metadata and enabled `emitSingle` cause TDZ issue ([0d89d81](0d89d81)), closes [unlight#16](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/16)
* Emit single with Prisma type ([94df9cf](94df9cf))
* Enum atomic operation are not processed ([43a2506](43a2506))
* Error too many open files ([2e67b25](2e67b25)), closes [unlight#162](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/162)
* Existence check of tsconfig ([4d523d2](4d523d2)), closes [unlight#23](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/23)
* Fix in getModelName helper ([190ab33](190ab33))
* Fix: Handle `FindUniq/First..OrThrowArgs` name ([0419d0d](0419d0d))
* Generate another commented class ([cc08dee](cc08dee))
* Generate correct json graphql type ([c6d8d46](c6d8d46))
* Generate distinct related enums with bound feature ([d055e3b](d055e3b))
* Generate enumerable filters ([9f35c9a](9f35c9a))
* **generate:** allow datamodels.type to be undefined ([faefc8f](faefc8f)), closes [unlight#106](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/106)
* Generator options: dasherizedName renamed to name ([c537340](c537340))
* Get graphql type for scalar list ([97a1ae4](97a1ae4)), closes [unlight#30](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/30)
* Get model name for CompoundUniqueInput ([f44aa85](f44aa85)), closes [unlight#53](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/53)
* Get model name from `{Model}AggregateArgs` type ([0703f7e](0703f7e))
* Getting json nullable enum ([d001714](d001714))
* Hide field for model type ([54571d2](54571d2))
* **hide field:** Fields in nested types ([2760d9e](2760d9e)), closes [unlight#80](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/80)
* **hide field:** Missing import of enum type ([b067142](b067142)), closes [unlight#73](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/73)
* **hide field:** Self relation field ([5cb4311](5cb4311)), closes [unlight#103](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/103)
* Json type changed to `Record<string, any>` ([2877be7](2877be7))
* Loading existing file ([fc19a03](fc19a03))
* Make fields in count output undefinable ([8e3d85c](8e3d85c))
* Make types same as in prisma ([1f5bc4e](1f5bc4e))
* Missing enum import type with enum filter object ([a5356c3](a5356c3)), closes [unlight#3](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/3)
* Missing import in hidden type ([29e5a8e](29e5a8e)), closes [unlight#62](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/62)
* Model types mismatch ([ffe70b6](ffe70b6)), closes [unlight#21](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/21)
* **mongodb:** Get matching input type from Json ([e16cad0](e16cad0))
* **mongodb:** Support composite types (behaves like model) ([d505ecb](d505ecb)), closes [unlight#99](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/99)
* More precise get model name ([96323c1](96323c1))
* Multiple namespace imports ([e096af0](e096af0)), closes [unlight#27](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/27)
* No atomic operations for scalar input list ([e55767b](e55767b))
* No atomic operations for scalar input list ([d32b03c](d32b03c))
* **other:** Decimal convert error ([67e6ccf](67e6ccf)), closes [unlight#113](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/113)
* **other:** Fail model with single id field in mongodb ([4d19e9a](4d19e9a)), closes [unlight#96](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/96)
* **other:** Ignore `@HideField()` for output count fields ([ce3eec2](ce3eec2)), closes [unlight#33](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/33)
* **other:** Makes proptype resolution behave like fieldtype ([850018a](850018a))
* Pin `ts-morph` to specific range ([d076fe9](d076fe9)), closes [unlight#146](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/146)
* Prisma client generator is optional ([4ce28f1](4ce28f1)), closes [unlight#25](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/25)
* **prisma:** Adapt generator to Prisma v2.13 ([d1ae8b1](d1ae8b1))
* Re-export iteration process fail ([bad1034](bad1034))
* Re-release 1.9.3 ([a52f31d](a52f31d))
* Regenerate enum ignoring existing values ([c581bc7](c581bc7)), closes [unlight#45](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/45)
* Regenerate model ignoring existing data ([62ffd83](62ffd83)), closes [unlight#45](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/45)
* Remove duplicated input types ([53d5721](53d5721))
* Remove empty input types ([20c4f46](20c4f46)), closes [unlight#26](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/26)
* Remove unused classes when both noAtomicOperations and emitSingle enabled ([41ce3c1](41ce3c1)), closes [unlight#89](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/89)
* Remove unused imports in generated files ([96ef374](96ef374))
* Removed unnecessary create enum from input type ([e6774ab](e6774ab))
* Renamed config option ([d989cfe](d989cfe))
* Save files without intermediate layer ([4a07bea](4a07bea))
* Scalar filters compatibility ([02acba8](02acba8))
* Select input type from multiple options ([81aeb02](81aeb02))
* Source file already exists error ([121a486](121a486))
* Switched to replace mode ([d04c3ef](d04c3ef))
* Type mismatch between prisma types ([b5587cd](b5587cd)), closes [unlight#4](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/4)
* Typescript property type now same as graphql type ([151d380](151d380))

### Performance Improvements

* Generation of inputs/outputs ([4604160](4604160))
* Removed unused code ([da6dbc0](da6dbc0))
* Removed unused code ([28f8784](28f8784))
* Slightly improved ([fd88dc9](fd88dc9))

### Miscellaneous Chores

* Bump version ([3267147](3267147))
* Removed deprecated setting `types_*` ([3491398](3491398))
* Renamed config option `atomicNumberOperation` to `noAtomicOperations` ([6078eb9](6078eb9))
* Update library to support to Prisma v4 ([1456303](1456303)), closes [unlight#123](https://github.com/resident-advisor/prisma-nestjs-graphql/issues/123)
* Update packages ([7e640a7](7e640a7))

### Code Refactoring

* Combine scalar filters ([789cfeb](789cfeb))
* Removed `renameZooTypes` config option ([71bfb68](71bfb68))
* Renamed token in `outputFilePattern` template ([95d4629](95d4629))
* Replace `matcher` by `outmatch` ([fa7c003](fa7c003))
Coventh added a commit to Coventh/prisma-nestjs-graphql that referenced this issue Nov 14, 2024
## [19.2.0](unlight/prisma-nestjs-graphql@v19.1.0...v19.2.0) (2023-09-23)

### Features

* **compatibility:** New configuration option `unsafeCompatibleWhereUniqueInput` ([72a3dab](unlight/prisma-nestjs-graphql@72a3dab)), closes [#177](unlight/prisma-nestjs-graphql#177)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed released on @next released
Projects
None yet
Development

No branches or pull requests

8 participants