prisma-nestjs-graphql 14.6.2 → 15.0.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.
- package/README.md +34 -2
- package/index.js +488 -258
- package/package.json +27 -23
package/README.md
CHANGED
|
@@ -279,6 +279,38 @@ data!: UserCreateInput;
|
|
|
279
279
|
|
|
280
280
|
```
|
|
281
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
|
+
|
|
282
314
|
## Field Settings
|
|
283
315
|
|
|
284
316
|
Special directives in triple slash comments for more precise code generation.
|
|
@@ -529,7 +561,7 @@ Named import example:
|
|
|
529
561
|
```prisma
|
|
530
562
|
model Transfer {
|
|
531
563
|
id String @id
|
|
532
|
-
/// @PropertyType({ name: 'Prisma.Decimal', from: '@prisma/client', namedImport: true })
|
|
564
|
+
/// @PropertyType({ name: 'Prisma.Decimal', from: '@prisma/client', namedImport: true, input: true })
|
|
533
565
|
money Decimal
|
|
534
566
|
}
|
|
535
567
|
```
|
|
@@ -540,7 +572,7 @@ May generate following:
|
|
|
540
572
|
import { Prisma } from '@prisma/client';
|
|
541
573
|
|
|
542
574
|
@ObjectType()
|
|
543
|
-
export class
|
|
575
|
+
export class TransferCreateInput {
|
|
544
576
|
@Field(() => GraphQLDecimal)
|
|
545
577
|
money!: Prisma.Decimal;
|
|
546
578
|
}
|