@pothos/plugin-prisma 4.0.5 → 4.2.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 (171) hide show
  1. package/CHANGELOG.md +17 -4
  2. package/dts/connection-helpers.d.ts +2 -2
  3. package/dts/connection-helpers.d.ts.map +1 -1
  4. package/dts/global-types.d.ts +9 -9
  5. package/dts/global-types.d.ts.map +1 -1
  6. package/dts/index.d.ts +2 -2
  7. package/dts/index.d.ts.map +1 -1
  8. package/dts/interface-ref.d.ts +2 -2
  9. package/dts/interface-ref.d.ts.map +1 -1
  10. package/dts/model-loader.d.ts +4 -4
  11. package/dts/model-loader.d.ts.map +1 -1
  12. package/dts/node-ref.d.ts +1 -1
  13. package/dts/node-ref.d.ts.map +1 -1
  14. package/dts/object-ref.d.ts +1 -1
  15. package/dts/object-ref.d.ts.map +1 -1
  16. package/dts/prisma-field-builder.d.ts +5 -5
  17. package/dts/prisma-field-builder.d.ts.map +1 -1
  18. package/dts/types.d.ts +8 -8
  19. package/dts/types.d.ts.map +1 -1
  20. package/dts/util/cursors.d.ts +3 -3
  21. package/dts/util/cursors.d.ts.map +1 -1
  22. package/dts/util/datamodel.d.ts +3 -3
  23. package/dts/util/datamodel.d.ts.map +1 -1
  24. package/dts/util/deep-equal.d.ts.map +1 -1
  25. package/dts/util/description.d.ts +1 -1
  26. package/dts/util/description.d.ts.map +1 -1
  27. package/dts/util/get-client.d.ts +2 -2
  28. package/dts/util/get-client.d.ts.map +1 -1
  29. package/dts/util/loader-map.d.ts +2 -2
  30. package/dts/util/loader-map.d.ts.map +1 -1
  31. package/dts/util/map-query.d.ts +13 -8
  32. package/dts/util/map-query.d.ts.map +1 -1
  33. package/dts/util/relation-map.d.ts +1 -1
  34. package/dts/util/relation-map.d.ts.map +1 -1
  35. package/dts/util/selections.d.ts +2 -2
  36. package/dts/util/selections.d.ts.map +1 -1
  37. package/dts/util/usage.d.ts.map +1 -1
  38. package/esm/connection-helpers.d.ts +2 -2
  39. package/esm/connection-helpers.d.ts.map +1 -1
  40. package/esm/field-builder.js +6 -6
  41. package/esm/field-builder.js.map +1 -1
  42. package/esm/generator.js +5 -5
  43. package/esm/generator.js.map +1 -1
  44. package/esm/global-types.d.ts +9 -9
  45. package/esm/global-types.d.ts.map +1 -1
  46. package/esm/global-types.js +1 -1
  47. package/esm/global-types.js.map +1 -1
  48. package/esm/index.d.ts +2 -2
  49. package/esm/index.d.ts.map +1 -1
  50. package/esm/index.js +4 -4
  51. package/esm/index.js.map +1 -1
  52. package/esm/interface-ref.d.ts +2 -2
  53. package/esm/interface-ref.d.ts.map +1 -1
  54. package/esm/interface-ref.js.map +1 -1
  55. package/esm/model-loader.d.ts +4 -4
  56. package/esm/model-loader.d.ts.map +1 -1
  57. package/esm/model-loader.js +13 -15
  58. package/esm/model-loader.js.map +1 -1
  59. package/esm/node-ref.d.ts +1 -1
  60. package/esm/node-ref.d.ts.map +1 -1
  61. package/esm/object-ref.d.ts +1 -1
  62. package/esm/object-ref.d.ts.map +1 -1
  63. package/esm/object-ref.js +4 -2
  64. package/esm/object-ref.js.map +1 -1
  65. package/esm/prisma-field-builder.d.ts +5 -5
  66. package/esm/prisma-field-builder.d.ts.map +1 -1
  67. package/esm/prisma-field-builder.js +7 -8
  68. package/esm/prisma-field-builder.js.map +1 -1
  69. package/esm/schema-builder.js +1 -1
  70. package/esm/schema-builder.js.map +1 -1
  71. package/esm/types.d.ts +8 -8
  72. package/esm/types.d.ts.map +1 -1
  73. package/esm/types.js.map +1 -1
  74. package/esm/util/cursors.d.ts +3 -3
  75. package/esm/util/cursors.d.ts.map +1 -1
  76. package/esm/util/cursors.js +2 -2
  77. package/esm/util/cursors.js.map +1 -1
  78. package/esm/util/datamodel.d.ts +3 -3
  79. package/esm/util/datamodel.d.ts.map +1 -1
  80. package/esm/util/datamodel.js.map +1 -1
  81. package/esm/util/deep-equal.d.ts.map +1 -1
  82. package/esm/util/deep-equal.js +1 -1
  83. package/esm/util/deep-equal.js.map +1 -1
  84. package/esm/util/description.d.ts +1 -1
  85. package/esm/util/description.d.ts.map +1 -1
  86. package/esm/util/description.js +1 -1
  87. package/esm/util/description.js.map +1 -1
  88. package/esm/util/get-client.d.ts +2 -2
  89. package/esm/util/get-client.d.ts.map +1 -1
  90. package/esm/util/get-client.js +1 -1
  91. package/esm/util/get-client.js.map +1 -1
  92. package/esm/util/loader-map.d.ts +2 -2
  93. package/esm/util/loader-map.d.ts.map +1 -1
  94. package/esm/util/loader-map.js +4 -5
  95. package/esm/util/loader-map.js.map +1 -1
  96. package/esm/util/map-query.d.ts +13 -8
  97. package/esm/util/map-query.d.ts.map +1 -1
  98. package/esm/util/map-query.js +20 -19
  99. package/esm/util/map-query.js.map +1 -1
  100. package/esm/util/relation-map.d.ts +1 -1
  101. package/esm/util/relation-map.d.ts.map +1 -1
  102. package/esm/util/relation-map.js +12 -12
  103. package/esm/util/relation-map.js.map +1 -1
  104. package/esm/util/selections.d.ts +2 -2
  105. package/esm/util/selections.d.ts.map +1 -1
  106. package/esm/util/selections.js +9 -9
  107. package/esm/util/selections.js.map +1 -1
  108. package/esm/util/usage.d.ts.map +1 -1
  109. package/esm/util/usage.js +0 -1
  110. package/esm/util/usage.js.map +1 -1
  111. package/generated.d.ts +1 -1
  112. package/lib/field-builder.js +7 -5
  113. package/lib/field-builder.js.map +1 -1
  114. package/lib/generator.js +4 -4
  115. package/lib/generator.js.map +1 -1
  116. package/lib/global-types.js +1 -1
  117. package/lib/global-types.js.map +1 -1
  118. package/lib/index.js +4 -4
  119. package/lib/index.js.map +1 -1
  120. package/lib/interface-ref.js.map +1 -1
  121. package/lib/model-loader.js +12 -14
  122. package/lib/model-loader.js.map +1 -1
  123. package/lib/object-ref.js +3 -1
  124. package/lib/object-ref.js.map +1 -1
  125. package/lib/prisma-field-builder.js +6 -7
  126. package/lib/prisma-field-builder.js.map +1 -1
  127. package/lib/schema-builder.js +1 -1
  128. package/lib/schema-builder.js.map +1 -1
  129. package/lib/types.js.map +1 -1
  130. package/lib/util/cursors.js +2 -2
  131. package/lib/util/cursors.js.map +1 -1
  132. package/lib/util/datamodel.js.map +1 -1
  133. package/lib/util/deep-equal.js +1 -1
  134. package/lib/util/deep-equal.js.map +1 -1
  135. package/lib/util/description.js +1 -1
  136. package/lib/util/description.js.map +1 -1
  137. package/lib/util/get-client.js +1 -1
  138. package/lib/util/get-client.js.map +1 -1
  139. package/lib/util/loader-map.js +4 -5
  140. package/lib/util/loader-map.js.map +1 -1
  141. package/lib/util/map-query.js +20 -19
  142. package/lib/util/map-query.js.map +1 -1
  143. package/lib/util/relation-map.js +12 -12
  144. package/lib/util/relation-map.js.map +1 -1
  145. package/lib/util/selections.js +9 -9
  146. package/lib/util/selections.js.map +1 -1
  147. package/lib/util/usage.js +0 -1
  148. package/lib/util/usage.js.map +1 -1
  149. package/package.json +12 -12
  150. package/src/connection-helpers.ts +2 -2
  151. package/src/field-builder.ts +30 -19
  152. package/src/generator.ts +5 -8
  153. package/src/global-types.ts +33 -28
  154. package/src/index.ts +12 -11
  155. package/src/interface-ref.ts +2 -2
  156. package/src/model-loader.ts +17 -19
  157. package/src/node-ref.ts +1 -1
  158. package/src/object-ref.ts +5 -3
  159. package/src/prisma-field-builder.ts +54 -53
  160. package/src/schema-builder.ts +8 -8
  161. package/src/types.ts +59 -60
  162. package/src/util/cursors.ts +7 -8
  163. package/src/util/datamodel.ts +3 -3
  164. package/src/util/deep-equal.ts +0 -1
  165. package/src/util/description.ts +1 -2
  166. package/src/util/get-client.ts +2 -3
  167. package/src/util/loader-map.ts +6 -8
  168. package/src/util/map-query.ts +49 -46
  169. package/src/util/relation-map.ts +13 -13
  170. package/src/util/selections.ts +10 -12
  171. package/src/util/usage.ts +0 -2
@@ -1,34 +1,32 @@
1
- /* eslint-disable no-nested-ternary */
2
- /* eslint-disable no-underscore-dangle */
3
1
  import {
4
- FieldNode,
2
+ type CompatibleTypes,
3
+ type ExposeNullability,
4
+ type FieldKind,
5
+ type FieldRef,
6
+ type InferredFieldOptionKeys,
7
+ type InputFieldMap,
8
+ type InterfaceParam,
9
+ type MaybePromise,
10
+ type NormalizeArgs,
11
+ ObjectRef,
12
+ type PluginName,
13
+ RootFieldBuilder,
14
+ type SchemaTypes,
15
+ type ShapeFromTypeParam,
16
+ type TypeParam,
17
+ isThenable,
18
+ } from '@pothos/core';
19
+ import {
20
+ type FieldNode,
21
+ type GraphQLResolveInfo,
22
+ Kind,
5
23
  getNamedType,
6
- GraphQLResolveInfo,
7
24
  isInterfaceType,
8
25
  isObjectType,
9
- Kind,
10
26
  } from 'graphql';
11
- import {
12
- CompatibleTypes,
13
- ExposeNullability,
14
- FieldKind,
15
- FieldRef,
16
- InferredFieldOptionKeys,
17
- InputFieldMap,
18
- InterfaceParam,
19
- isThenable,
20
- MaybePromise,
21
- NormalizeArgs,
22
- ObjectRef,
23
- PluginName,
24
- RootFieldBuilder,
25
- SchemaTypes,
26
- ShapeFromTypeParam,
27
- TypeParam,
28
- } from '@pothos/core';
29
- import { PrismaRef } from './interface-ref';
27
+ import type { PrismaRef } from './interface-ref';
30
28
  import { ModelLoader } from './model-loader';
31
- import {
29
+ import type {
32
30
  PrismaConnectionShape,
33
31
  PrismaModelTypes,
34
32
  RelatedConnectionOptions,
@@ -47,11 +45,11 @@ import {
47
45
  } from './util/cursors';
48
46
  import { getRefFromModel, getRelation } from './util/datamodel';
49
47
  import { getFieldDescription } from './util/description';
50
- import { FieldMap } from './util/relation-map';
48
+ import type { FieldMap } from './util/relation-map';
51
49
 
52
50
  // Workaround for FieldKind not being extended on Builder classes
53
51
  const RootBuilder: {
54
- // eslint-disable-next-line @typescript-eslint/prefer-function-type
52
+ // biome-ignore lint/suspicious/noRedeclare: <explanation>
55
53
  new <Types extends SchemaTypes, Shape, Kind extends FieldKind>(
56
54
  builder: PothosSchemaTypes.SchemaBuilder<Types>,
57
55
  kind: FieldKind,
@@ -59,21 +57,26 @@ const RootBuilder: {
59
57
  ): PothosSchemaTypes.RootFieldBuilder<Types, Shape, Kind>;
60
58
  } = RootFieldBuilder as never;
61
59
 
62
- type ContextForAuth<Types extends SchemaTypes, Scopes extends {} = {}> =
63
- PothosSchemaTypes.ScopeAuthContextForAuth<Types, Scopes> extends {
64
- Context: infer T;
65
- }
66
- ? T extends object
67
- ? T
68
- : object
69
- : object;
70
-
71
- type FieldAuthScopes<Types extends SchemaTypes, Parent, Args extends {} = {}> =
72
- PothosSchemaTypes.ScopeAuthFieldAuthScopes<Types, Parent, Args> extends {
73
- Scopes: infer T;
74
- }
60
+ type ContextForAuth<
61
+ Types extends SchemaTypes,
62
+ Scopes extends {} = {},
63
+ > = PothosSchemaTypes.ScopeAuthContextForAuth<Types, Scopes> extends {
64
+ Context: infer T;
65
+ }
66
+ ? T extends object
75
67
  ? T
76
- : never;
68
+ : object
69
+ : object;
70
+
71
+ type FieldAuthScopes<
72
+ Types extends SchemaTypes,
73
+ Parent,
74
+ Args extends {} = {},
75
+ > = PothosSchemaTypes.ScopeAuthFieldAuthScopes<Types, Parent, Args> extends {
76
+ Scopes: infer T;
77
+ }
78
+ ? T
79
+ : never;
77
80
 
78
81
  export class PrismaObjectFieldBuilder<
79
82
  Types extends SchemaTypes,
@@ -137,10 +140,6 @@ export class PrismaObjectFieldBuilder<
137
140
  >
138
141
  >
139
142
  >
140
- | ObjectRef<
141
- Types,
142
- ShapeFromConnection<PothosSchemaTypes.ConnectionShapeHelper<Types, Shape, false>>
143
- >
144
143
  | PothosSchemaTypes.ConnectionObjectOptions<
145
144
  Types,
146
145
  ObjectRef<
@@ -289,7 +288,7 @@ export class PrismaObjectFieldBuilder<
289
288
  const relationSelect = (
290
289
  args: object,
291
290
  context: object,
292
- nestedQuery: (query: unknown, path?: unknown) => { select?: {} },
291
+ nestedQuery: (query: unknown, path?: unknown) => { select?: object },
293
292
  getSelection: (path: string[]) => FieldNode | null,
294
293
  ) => {
295
294
  typeName ??= this.builder.configStore.getTypeConfig(ref).name;
@@ -411,7 +410,7 @@ export class PrismaObjectFieldBuilder<
411
410
  extensions: {
412
411
  pothosPrismaTotalCount: true,
413
412
  },
414
- resolve: (parent, args, context) => parent.totalCount,
413
+ resolve: (parent, _args, _context) => parent.totalCount,
415
414
  }),
416
415
  ...(connectionOptions as { fields?: (t: unknown) => {} }).fields?.(t),
417
416
  })
@@ -458,8 +457,8 @@ export class PrismaObjectFieldBuilder<
458
457
  const { query = {}, resolve, extensions, onNull, ...rest } = options;
459
458
 
460
459
  const relationSelect = (
461
- args: object,
462
- context: object,
460
+ _args: object,
461
+ _context: object,
463
462
  nestedQuery: (query: unknown) => unknown,
464
463
  ) => ({ select: { [name]: nestedQuery(query) } });
465
464
 
@@ -531,7 +530,7 @@ export class PrismaObjectFieldBuilder<
531
530
  type: 'Int',
532
531
  nullable: false,
533
532
  select: countSelect as never,
534
- resolve: (parent, args, context, info) =>
533
+ resolve: (parent, _args, _context, _info) =>
535
534
  (parent as unknown as { _count: Record<string, never> })._count?.[name],
536
535
  }) as FieldRef<Types, number, 'Object'>;
537
536
  }
@@ -559,8 +558,11 @@ export class PrismaObjectFieldBuilder<
559
558
  const ref: PrismaRef<Types, PrismaModelTypes> =
560
559
  typeof variant === 'string' ? getRefFromModel(variant, this.builder) : variant;
561
560
 
562
- const selfSelect = (args: object, context: object, nestedQuery: (query: unknown) => unknown) =>
563
- nestedQuery({});
561
+ const selfSelect = (
562
+ _args: object,
563
+ _context: object,
564
+ nestedQuery: (query: unknown) => unknown,
565
+ ) => nestedQuery({});
564
566
 
565
567
  return this.field({
566
568
  ...(options as {}),
@@ -684,7 +686,6 @@ function addScopes(
684
686
  ) {
685
687
  const originalCreateField = builder.createField;
686
688
 
687
- // eslint-disable-next-line no-param-reassign
688
689
  builder.createField = function createField(options) {
689
690
  return originalCreateField.call(this, {
690
691
  authScopes: scopes,
@@ -1,20 +1,20 @@
1
1
  import './global-types';
2
- import { GraphQLResolveInfo } from 'graphql';
3
2
  import SchemaBuilder, {
4
3
  brandWithType,
5
4
  completeValue,
6
- FieldRef,
7
- InterfaceRef,
8
- OutputType,
5
+ type FieldRef,
6
+ type InterfaceRef,
7
+ type OutputType,
9
8
  PothosError,
10
- SchemaTypes,
9
+ type SchemaTypes,
11
10
  } from '@pothos/core';
11
+ import type { GraphQLResolveInfo } from 'graphql';
12
12
  import { PrismaInterfaceRef } from './interface-ref';
13
13
  import { ModelLoader } from './model-loader';
14
14
  import { PrismaNodeRef } from './node-ref';
15
15
  import { PrismaObjectRef } from './object-ref';
16
16
  import { PrismaObjectFieldBuilder } from './prisma-field-builder';
17
- import { PrismaModelTypes, PrismaNodeOptions } from './types';
17
+ import type { PrismaModelTypes, PrismaNodeOptions } from './types';
18
18
  import { getDefaultIDParser, getDefaultIDSerializer } from './util/cursors';
19
19
  import { getDelegateFromModel, getRefFromModel } from './util/datamodel';
20
20
  import { getModelDescription } from './util/description';
@@ -187,12 +187,12 @@ schemaBuilderProto.prismaNode = function prismaNode(
187
187
  globalID: (options: Record<string, unknown>) => FieldRef<SchemaTypes, unknown>;
188
188
  }
189
189
  ).globalID({
190
- ...(this.options as { relayOptions?: { idFieldOptions?: {} } }).relayOptions
190
+ ...(this.options as { relayOptions?: { idFieldOptions?: object } }).relayOptions
191
191
  ?.idFieldOptions,
192
192
  ...idOptions,
193
193
  nullable: false,
194
194
  args: {},
195
- resolve: (parent: never, args: object, context: object, info: GraphQLResolveInfo) =>
195
+ resolve: (parent: never, _args: object, context: object) =>
196
196
  completeValue(resolve(parent, context), (id) => ({
197
197
  type: nodeConfig.name,
198
198
  id,
package/src/types.ts CHANGED
@@ -1,33 +1,35 @@
1
- import { FieldNode, GraphQLResolveInfo } from 'graphql';
2
1
  import {
3
- ArgumentRef,
4
- FieldKind,
5
- FieldMap,
6
- FieldNullability,
7
- FieldOptionsFromKind,
8
- InferredFieldOptionsByKind,
9
- InferredFieldOptionKeys,
10
- InputFieldMap,
11
- InputFieldsFromShape,
12
- InputShapeFromFields,
13
- InterfaceParam,
14
- ListResolveValue,
15
- MaybePromise,
16
- Normalize,
17
- ObjectRef,
18
- OutputShape,
19
- OutputType,
20
- SchemaTypes,
21
- ShapeFromTypeParam,
22
- ShapeWithNullability,
2
+ type ArgumentRef,
3
+ type FieldKind,
4
+ type FieldMap,
5
+ type FieldNullability,
6
+ type FieldOptionsFromKind,
7
+ type InferredFieldOptionKeys,
8
+ type InferredFieldOptionsByKind,
9
+ type InputFieldMap,
10
+ type InputFieldsFromShape,
11
+ type InputShapeFromFields,
12
+ type InterfaceParam,
13
+ type ListResolveValue,
14
+ type MaybePromise,
15
+ type Normalize,
16
+ type ObjectRef,
17
+ type OutputShape,
18
+ type OutputType,
19
+ type SchemaTypes,
20
+ type ShapeFromTypeParam,
21
+ type ShapeWithNullability,
22
+ type TypeParam,
23
23
  typeBrandKey,
24
- TypeParam,
25
24
  } from '@pothos/core';
26
- import { PrismaInterfaceRef, PrismaRef } from './interface-ref';
25
+ import type { FieldNode, GraphQLResolveInfo } from 'graphql';
26
+ import type { PrismaInterfaceRef, PrismaRef } from './interface-ref';
27
27
  import type { PrismaObjectFieldBuilder } from './prisma-field-builder';
28
28
 
29
29
  export interface PrismaDelegate {
30
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
30
31
  findUniqueOrThrow?: (...args: any[]) => Promise<unknown>;
32
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
31
33
  findUnique: (...args: any[]) => Promise<unknown>;
32
34
  }
33
35
 
@@ -84,6 +86,7 @@ export type PrismaObjectFieldOptions<
84
86
  ShapeFromSelection<
85
87
  Types,
86
88
  ExtractModel<Types, ParentShape>,
89
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
87
90
  { select: Select extends (...args: any[]) => infer S ? S : Select }
88
91
  >,
89
92
  > = PothosSchemaTypes.ObjectFieldOptions<Types, Shape, Type, Nullable, Args, ResolveReturnShape> &
@@ -499,10 +502,11 @@ export type RelationCountOptions<
499
502
  export type PrismaFieldOptions<
500
503
  Types extends SchemaTypes,
501
504
  ParentShape,
502
- Type extends
505
+ Type extends // biome-ignore lint/suspicious/noExplicitAny: <explanation>
503
506
  | PrismaRef<any, PrismaModelTypes>
504
507
  | keyof Types['PrismaTypes']
505
508
  | [keyof Types['PrismaTypes']]
509
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
506
510
  | [PrismaRef<any, PrismaModelTypes>],
507
511
  Model extends PrismaModelTypes,
508
512
  Param extends TypeParam<Types>,
@@ -511,34 +515,26 @@ export type PrismaFieldOptions<
511
515
  ResolveShape,
512
516
  ResolveReturnShape,
513
517
  Kind extends FieldKind = FieldKind,
514
- > =
515
- FieldOptionsFromKind<
516
- Types,
517
- ParentShape,
518
- Param,
519
- Nullable,
520
- Args,
521
- Kind,
522
- ResolveShape,
523
- ResolveReturnShape
524
- > extends infer FieldOptions
525
- ? Omit<FieldOptions, InferredFieldOptionKeys | 'type'> & {
526
- type: Type;
527
- resolve: FieldOptions extends {
528
- resolve?: (parent: infer Parent, ...args: any[]) => unknown;
529
- }
530
- ? PrismaFieldResolver<Types, Model, Parent, Param, Args, Nullable, ResolveReturnShape>
531
- : PrismaFieldResolver<
532
- Types,
533
- Model,
534
- ParentShape,
535
- Param,
536
- Args,
537
- Nullable,
538
- ResolveReturnShape
539
- >;
518
+ > = FieldOptionsFromKind<
519
+ Types,
520
+ ParentShape,
521
+ Param,
522
+ Nullable,
523
+ Args,
524
+ Kind,
525
+ ResolveShape,
526
+ ResolveReturnShape
527
+ > extends infer FieldOptions
528
+ ? Omit<FieldOptions, InferredFieldOptionKeys | 'type'> & {
529
+ type: Type;
530
+ resolve: FieldOptions extends {
531
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
532
+ resolve?: (parent: infer Parent, ...args: any[]) => unknown;
540
533
  }
541
- : never;
534
+ ? PrismaFieldResolver<Types, Model, Parent, Param, Args, Nullable, ResolveReturnShape>
535
+ : PrismaFieldResolver<Types, Model, ParentShape, Param, Args, Nullable, ResolveReturnShape>;
536
+ }
537
+ : never;
542
538
 
543
539
  export type PrismaFieldWithInputOptions<
544
540
  Types extends SchemaTypes,
@@ -546,10 +542,11 @@ export type PrismaFieldWithInputOptions<
546
542
  Kind extends FieldKind,
547
543
  Args extends InputFieldMap,
548
544
  Fields extends InputFieldMap,
549
- Type extends
545
+ Type extends // biome-ignore lint/suspicious/noExplicitAny: <explanation>
550
546
  | PrismaRef<any, PrismaModelTypes>
551
547
  | keyof Types['PrismaTypes']
552
548
  | [keyof Types['PrismaTypes']]
549
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
553
550
  | [PrismaRef<any, PrismaModelTypes>],
554
551
  Model extends PrismaModelTypes,
555
552
  Param extends TypeParam<Types>,
@@ -617,8 +614,9 @@ export type PrismaFieldResolver<
617
614
  export type PrismaConnectionFieldOptions<
618
615
  Types extends SchemaTypes,
619
616
  ParentShape,
620
- Type extends
621
- | PrismaInterfaceRef<Types, PrismaModelTypes>
617
+ Type extends // biome-ignore lint/suspicious/noExplicitAny: <explanation>
618
+ | PrismaInterfaceRef<any, PrismaModelTypes>
619
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
622
620
  | PrismaRef<any, PrismaModelTypes>
623
621
  | keyof Types['PrismaTypes'],
624
622
  Model extends PrismaModelTypes,
@@ -627,7 +625,6 @@ export type PrismaConnectionFieldOptions<
627
625
  Args extends InputFieldMap,
628
626
  ResolveReturnShape,
629
627
  Kind extends FieldKind,
630
- // eslint-disable-next-line @typescript-eslint/sort-type-constituents
631
628
  > = Omit<
632
629
  FieldOptionsFromKind<
633
630
  Types,
@@ -693,7 +690,6 @@ export type RelatedConnectionOptions<
693
690
  Field extends Model['ListRelations'],
694
691
  Nullable extends boolean,
695
692
  Args extends InputFieldMap,
696
- // eslint-disable-next-line @typescript-eslint/sort-type-constituents
697
693
  > = Omit<
698
694
  PothosSchemaTypes.ObjectFieldOptions<
699
695
  Types,
@@ -758,7 +754,7 @@ export type IncludeMap = Record<string, SelectionMap | boolean>;
758
754
  export interface SelectionMap {
759
755
  select?: Record<string, SelectionMap | boolean>;
760
756
  include?: Record<string, SelectionMap | boolean>;
761
- where?: {};
757
+ where?: object;
762
758
  }
763
759
 
764
760
  export type FieldSelection =
@@ -849,7 +845,8 @@ type InferModelShape<Model> = Simplify<
849
845
  // Infer relations for a given model
850
846
  type InferRelations<Model> = {
851
847
  [K in keyof Model]: {
852
- Shape: Model[K] extends Array<any> ? InferModelShape<Model[K][0]>[] : InferModelShape<Model[K]>;
848
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
849
+ Shape: Model[K] extends any[] ? InferModelShape<Model[K][0]>[] : InferModelShape<Model[K]>;
853
850
  Name: InferField<InferItemOfArray<Model[K]>, 'name'>;
854
851
  Nullable: IsNullable<Model[K]>;
855
852
  };
@@ -857,7 +854,8 @@ type InferRelations<Model> = {
857
854
 
858
855
  // Create a list of keys that represent array relations
859
856
  type InferRelationList<Model> = {
860
- [K in keyof Model as Model[K] extends Array<any> ? K : never]: K;
857
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
858
+ [K in keyof Model as Model[K] extends any[] ? K : never]: K;
861
859
  };
862
860
 
863
861
  // Make a type nullable if IsNullable is true
@@ -868,7 +866,8 @@ type InferItemOfArray<T> = T extends Array<infer U> ? U : T;
868
866
 
869
867
  // Infers the composites of a given model
870
868
  type InferComposites<Model> = {
871
- [K in keyof Model]: Model[K] extends Array<any>
869
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
870
+ [K in keyof Model]: Model[K] extends any[]
872
871
  ? Simplify<
873
872
  InferField<Model[K][0], 'scalars'> & InferComposites<InferField<Model[K][0], 'composites'>>
874
873
  >[]
@@ -1,13 +1,12 @@
1
- /* eslint-disable no-nested-ternary */
2
1
  import {
2
+ type MaybePromise,
3
+ PothosValidationError,
4
+ type SchemaTypes,
3
5
  decodeBase64,
4
6
  encodeBase64,
5
- MaybePromise,
6
- PothosValidationError,
7
- SchemaTypes,
8
7
  } from '@pothos/core';
9
8
  import { getModel } from './datamodel';
10
- import { DMMFField } from './get-client';
9
+ import type { DMMFField } from './get-client';
11
10
  import { extendWithUsage } from './usage';
12
11
 
13
12
  const DEFAULT_MAX_SIZE = 100;
@@ -303,7 +302,7 @@ export function wrapConnectionResult<T extends {}>(
303
302
  },
304
303
  };
305
304
 
306
- const edges = nodes.map((value, index) =>
305
+ const edges = nodes.map((value) =>
307
306
  value == null
308
307
  ? null
309
308
  : resolveNode
@@ -331,8 +330,8 @@ export async function resolvePrismaCursorConnection<T extends {}>(
331
330
  options: ResolvePrismaCursorConnectionOptions,
332
331
  cursor: (node: T) => string,
333
332
  resolve: (query: {
334
- include?: {};
335
- cursor?: {};
333
+ include?: object;
334
+ cursor?: object;
336
335
  take: number;
337
336
  skip: number;
338
337
  }) => MaybePromise<readonly T[]>,
@@ -1,7 +1,7 @@
1
- import { ObjectRef, PothosSchemaError, SchemaTypes } from '@pothos/core';
2
- import { PrismaInterfaceRef, PrismaRef } from '../interface-ref';
1
+ import { type ObjectRef, PothosSchemaError, type SchemaTypes } from '@pothos/core';
2
+ import { PrismaInterfaceRef, type PrismaRef } from '../interface-ref';
3
3
  import { PrismaObjectRef } from '../object-ref';
4
- import { PrismaClient, PrismaDelegate, PrismaModelTypes } from '../types';
4
+ import type { PrismaClient, PrismaDelegate, PrismaModelTypes } from '../types';
5
5
  import { getDMMF } from './get-client';
6
6
 
7
7
  export const refMap = new WeakMap<object, Map<string, PrismaRef<never, PrismaModelTypes>>>();
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-continue */
2
1
  export function deepEqual(left: unknown, right: unknown, ignore?: Set<string>) {
3
2
  if (left === right) {
4
3
  return true;
@@ -1,5 +1,4 @@
1
- /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
2
- import { SchemaTypes } from '@pothos/core';
1
+ import type { SchemaTypes } from '@pothos/core';
3
2
  import { getFieldData, getModel } from './datamodel';
4
3
 
5
4
  export function getFieldDescription<Types extends SchemaTypes>(
@@ -1,6 +1,5 @@
1
- /* eslint-disable no-underscore-dangle */
2
- import { createContextCache, SchemaTypes } from '@pothos/core';
3
- import { PrismaClient } from '../types';
1
+ import { type SchemaTypes, createContextCache } from '@pothos/core';
2
+ import type { PrismaClient } from '../types';
4
3
 
5
4
  export interface DMMFField {
6
5
  type: string;
@@ -1,8 +1,8 @@
1
- import { GraphQLResolveInfo } from 'graphql';
2
1
  import { createContextCache } from '@pothos/core';
3
- import { LoaderMappings } from '../types';
2
+ import type { GraphQLResolveInfo } from 'graphql';
3
+ import type { LoaderMappings } from '../types';
4
4
 
5
- const cache = createContextCache((ctx) => new Map<string, LoaderMappings>());
5
+ const cache = createContextCache(() => new Map<string, LoaderMappings>());
6
6
 
7
7
  export function cacheKey(type: string, path: GraphQLResolveInfo['path'], subPath: string[] = []) {
8
8
  let key = '';
@@ -23,15 +23,13 @@ export function cacheKey(type: string, path: GraphQLResolveInfo['path'], subPath
23
23
  }
24
24
 
25
25
  export function setLoaderMappings(ctx: object, info: GraphQLResolveInfo, value: LoaderMappings) {
26
- Object.keys(value).forEach((field) => {
27
- const map = cache(ctx);
28
-
29
- const mapping = value[field];
26
+ const map = cache(ctx);
27
+ for (const [field, mapping] of Object.entries(value)) {
30
28
  const subPath = [...mapping.indirectPath, field];
31
29
  const key = cacheKey(mapping.type, info.path, subPath);
32
30
 
33
31
  map.set(key, mapping.mappings);
34
- });
32
+ }
35
33
  }
36
34
 
37
35
  export function getLoaderMapping(ctx: object, path: GraphQLResolveInfo['path'], type: string) {