prisma-nestjs-graphql 14.6.0 → 14.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +36 -2
  2. package/index.js +539 -253
  3. package/package.json +47 -46
package/README.md CHANGED
@@ -128,10 +128,11 @@ Default: `false`
128
128
 
129
129
  #### `requireSingleFieldsInWhereUniqueInput`
130
130
 
131
- When a `Model`s `WhereUniqueInput` class has only a single field, mark that field as **required** (TypeScript) and **not nullable** (GraphQL).
131
+ When a model `*WhereUniqueInput` class has only a single field, mark that field as **required** (TypeScript) and **not nullable** (GraphQL).
132
132
  See [#58](https://github.com/unlight/prisma-nestjs-graphql/issues/58) for more details.
133
133
  Type: `boolean`
134
- Default: `false`
134
+ Default: `false`
135
+ **Note**: It will break compatiblity between Prisma types and generated classes.
135
136
 
136
137
  #### `useInputType`
137
138
 
@@ -278,6 +279,38 @@ data!: UserCreateInput;
278
279
 
279
280
  ```
280
281
 
282
+ #### `graphqlScalars`
283
+
284
+ Allow to set custom graphql type for Prisma scalar type.
285
+ Format:
286
+
287
+ ```
288
+ graphqlScalars_{type}_name = "string"
289
+ graphqlScalars_{type}_specifier = "string"
290
+ ```
291
+
292
+ where `{type}` is a prisma scalar type name (e.g. BigInt)
293
+
294
+ Example:
295
+
296
+ ```
297
+ graphqlScalars_BigInt_name = "GraphQLBigInt"
298
+ graphqlScalars_BigInt_specifier = "graphql-scalars"
299
+ ```
300
+
301
+ May generate:
302
+
303
+ ```ts
304
+ import { GraphQLBigInt } from 'graphql-scalars';
305
+
306
+ export class BigIntFilter {
307
+ @Field(() => GraphQLBigInt, { nullable: true })
308
+ equals?: bigint | number;
309
+ }
310
+ ```
311
+
312
+ It will affect all inputs and outputs types (including models).
313
+
281
314
  ## Field Settings
282
315
 
283
316
  Special directives in triple slash comments for more precise code generation.
@@ -635,6 +668,7 @@ export class User {}
635
668
 
636
669
  ## Similar Projects
637
670
 
671
+ - https://github.com/kimjbstar/prisma-class-generator
638
672
  - https://github.com/odroe/nest-gql-mix
639
673
  - https://github.com/rfermann/nestjs-prisma-graphql-generator
640
674
  - https://github.com/madscience/graphql-codegen-nestjs