@pothos/plugin-prisma 3.35.2 → 3.35.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.35.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 9fa27cf7: Transform dynamic type imports in d.ts files
8
+
9
+ ## 3.35.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 3a82d645: Apply esm transform to esm d.ts definitions
14
+
3
15
  ## 3.35.2
4
16
 
5
17
  ### Patch Changes
@@ -1,2 +1,2 @@
1
- export * from './prisma-field-builder';
2
- //# sourceMappingURL=field-builder.d.ts.map
1
+ export * from './prisma-field-builder.js';
2
+ //# sourceMappingURL=field-builder.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=generator.d.ts.map
2
+ //# sourceMappingURL=generator.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { FieldKind, FieldNullability, FieldRef, InputFieldMap, InputFieldRef, InterfaceParam, NormalizeArgs, OutputType, PluginName, SchemaTypes, ShapeFromTypeParam, TypeParam } from '@pothos/core';
2
- import PrismaNodeRef from './node-ref';
3
- import { prismaModelKey, PrismaObjectRef } from './object-ref';
4
- import { PrismaObjectFieldBuilder as InternalPrismaObjectFieldBuilder } from './prisma-field-builder';
5
- import { PrismaClient, PrismaConnectionFieldOptions, PrismaFieldOptions, PrismaFieldWithInputOptions, PrismaModelTypes, PrismaNodeOptions, PrismaObjectFieldOptions, PrismaObjectTypeOptions, ShapeFromConnection, ShapeFromSelection } from './types';
6
- import type { PrismaPlugin } from '.';
2
+ import PrismaNodeRef from './node-ref.js';
3
+ import { prismaModelKey, PrismaObjectRef } from './object-ref.js';
4
+ import { PrismaObjectFieldBuilder as InternalPrismaObjectFieldBuilder } from './prisma-field-builder.js';
5
+ import { PrismaClient, PrismaConnectionFieldOptions, PrismaFieldOptions, PrismaFieldWithInputOptions, PrismaModelTypes, PrismaNodeOptions, PrismaObjectFieldOptions, PrismaObjectTypeOptions, ShapeFromConnection, ShapeFromSelection } from './types.js';
6
+ import type { PrismaPlugin } from './index.js';
7
7
  declare global {
8
8
  export namespace PothosSchemaTypes {
9
9
  interface Plugins<Types extends SchemaTypes> {
@@ -19,7 +19,7 @@ declare global {
19
19
  };
20
20
  } | {
21
21
  filterConnectionTotalCount?: boolean;
22
- client: (ctx: Types['Context']) => PrismaClient;
22
+ client: (ctx: Types["Context"]) => PrismaClient;
23
23
  dmmf: {
24
24
  datamodel: unknown;
25
25
  };
@@ -33,43 +33,72 @@ declare global {
33
33
  PrismaTypes: {};
34
34
  }
35
35
  interface ExtendDefaultTypes<PartialTypes extends Partial<UserSchemaTypes>> {
36
- PrismaTypes: PartialTypes['PrismaTypes'] & {};
36
+ PrismaTypes: PartialTypes["PrismaTypes"] & {};
37
37
  }
38
38
  interface PothosKindToGraphQLType {
39
- PrismaObject: 'Object';
39
+ PrismaObject: "Object";
40
40
  }
41
41
  interface FieldOptionsByKind<Types extends SchemaTypes, ParentShape, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveShape, ResolveReturnShape> {
42
42
  PrismaObject: PrismaObjectFieldOptions<Types, ParentShape, Type, Nullable, Args, ResolveShape, ResolveReturnShape>;
43
43
  }
44
44
  interface SchemaBuilder<Types extends SchemaTypes> {
45
- prismaObject: <Name extends keyof Types['PrismaTypes'], Interfaces extends InterfaceParam<Types>[], FindUnique, Model extends PrismaModelTypes & Types['PrismaTypes'][Name], Include = unknown, Select = unknown>(name: Name, options: PrismaObjectTypeOptions<Types, Model, Interfaces, FindUnique, Include, Select, ShapeFromSelection<Model, {
45
+ prismaObject: <Name extends keyof Types["PrismaTypes"], Interfaces extends InterfaceParam<Types>[], FindUnique, Model extends PrismaModelTypes & Types["PrismaTypes"][Name], Include = unknown, Select = unknown>(name: Name, options: PrismaObjectTypeOptions<Types, Model, Interfaces, FindUnique, Include, Select, ShapeFromSelection<Model, {
46
46
  select: Select;
47
47
  include: Include;
48
48
  }>>) => PrismaObjectRef<Model, ShapeFromSelection<Model, {
49
49
  select: Select;
50
50
  include: Include;
51
51
  }>>;
52
- prismaNode: 'relay' extends PluginName ? <Name extends keyof Types['PrismaTypes'], Interfaces extends InterfaceParam<Types>[] = [], Include = unknown, Select = unknown, UniqueField = unknown>(name: Name, options: PrismaNodeOptions<Types, Types['PrismaTypes'][Name] & PrismaModelTypes, Interfaces, Include, Select, ShapeFromSelection<PrismaModelTypes & Types['PrismaTypes'][Name], {
52
+ prismaNode: "relay" extends PluginName ? <Name extends keyof Types["PrismaTypes"], Interfaces extends InterfaceParam<Types>[] = [
53
+ ], Include = unknown, Select = unknown, UniqueField = unknown>(name: Name, options: PrismaNodeOptions<Types, Types["PrismaTypes"][Name] & PrismaModelTypes, Interfaces, Include, Select, ShapeFromSelection<PrismaModelTypes & Types["PrismaTypes"][Name], {
53
54
  select: Select;
54
55
  include: Include;
55
- }>, UniqueField>) => PrismaNodeRef<Types['PrismaTypes'][Name] & PrismaModelTypes, ShapeFromSelection<PrismaModelTypes & Types['PrismaTypes'][Name], {
56
+ }>, UniqueField>) => PrismaNodeRef<Types["PrismaTypes"][Name] & PrismaModelTypes, ShapeFromSelection<PrismaModelTypes & Types["PrismaTypes"][Name], {
56
57
  select: Select;
57
58
  include: Include;
58
- }>> : '@pothos/plugin-relay is required to use this method';
59
+ }>> : "@pothos/plugin-relay is required to use this method";
59
60
  }
60
61
  interface RootFieldBuilder<Types extends SchemaTypes, ParentShape, Kind extends FieldKind = FieldKind> {
61
- prismaField: <Args extends InputFieldMap, TypeParam extends PrismaObjectRef<PrismaModelTypes> | keyof Types['PrismaTypes'] | [keyof Types['PrismaTypes']] | [PrismaObjectRef<PrismaModelTypes>], Nullable extends FieldNullability<Type>, ResolveShape, ResolveReturnShape, Type extends TypeParam extends [unknown] ? [ObjectRef<Model['Shape']>] : ObjectRef<Model['Shape']>, Model extends PrismaModelTypes = PrismaModelTypes & (TypeParam extends [keyof Types['PrismaTypes']] ? Types['PrismaTypes'][TypeParam[0]] : TypeParam extends [PrismaObjectRef<PrismaModelTypes>] ? TypeParam[0][typeof prismaModelKey] : TypeParam extends PrismaObjectRef<PrismaModelTypes> ? TypeParam[typeof prismaModelKey] : TypeParam extends keyof Types['PrismaTypes'] ? Types['PrismaTypes'][TypeParam] : never)>(options: PrismaFieldOptions<Types, ParentShape, TypeParam, Model, Type, Args, Nullable, ResolveShape, ResolveReturnShape, Kind>) => FieldRef<ShapeFromTypeParam<Types, Type, Nullable>>;
62
- prismaConnection: 'relay' extends PluginName ? <Type extends PrismaObjectRef<PrismaModelTypes> | keyof Types['PrismaTypes'], Nullable extends boolean, ResolveReturnShape, Args extends InputFieldMap = {}, Model extends PrismaModelTypes = Type extends PrismaObjectRef<infer T> ? T : PrismaModelTypes & Types['PrismaTypes'][Type & keyof Types['PrismaTypes']]>(options: PrismaConnectionFieldOptions<Types, ParentShape, Type, Model, ObjectRef<Model['Shape']>, Nullable, Args, ResolveReturnShape, Kind>, ...args: NormalizeArgs<[
63
- connectionOptions: ConnectionObjectOptions<Types, ObjectRef<Model['Shape']>, false, false, ResolveReturnShape>,
64
- edgeOptions: ConnectionEdgeObjectOptions<Types, ObjectRef<Model['Shape']>, false, ResolveReturnShape>
65
- ], 0>) => FieldRef<ShapeFromConnection<ConnectionShapeHelper<Types, Model['Shape'], Nullable>>> : '@pothos/plugin-relay is required to use this method';
66
- prismaFieldWithInput: 'prisma' extends PluginName ? <Fields extends Record<string, InputFieldRef<unknown, 'InputObject'>>, TypeParam extends PrismaObjectRef<PrismaModelTypes> | keyof Types['PrismaTypes'] | [keyof Types['PrismaTypes']] | [PrismaObjectRef<PrismaModelTypes>], Type extends TypeParam extends [unknown] ? [ObjectRef<Model['Shape']>] : ObjectRef<Model['Shape']>, ResolveShape, ResolveReturnShape, ArgRequired extends boolean, Args extends Record<string, InputFieldRef<unknown, 'Arg'>> = {}, Nullable extends FieldNullability<Type> = Types['DefaultFieldNullability'], InputName extends string = 'input', Model extends PrismaModelTypes = PrismaModelTypes & (TypeParam extends [keyof Types['PrismaTypes']] ? Types['PrismaTypes'][TypeParam[0]] : TypeParam extends [PrismaObjectRef<PrismaModelTypes>] ? TypeParam[0][typeof prismaModelKey] : TypeParam extends PrismaObjectRef<PrismaModelTypes> ? TypeParam[typeof prismaModelKey] : TypeParam extends keyof Types['PrismaTypes'] ? Types['PrismaTypes'][TypeParam] : never)>(options: PrismaFieldWithInputOptions<Types, ParentShape, Kind, Args, Fields, TypeParam, Model, Type, Nullable, InputName, ResolveShape, ResolveReturnShape, boolean extends ArgRequired ? (Types & {
62
+ prismaField: <Args extends InputFieldMap, TypeParam extends PrismaObjectRef<PrismaModelTypes> | keyof Types["PrismaTypes"] | [
63
+ keyof Types["PrismaTypes"]
64
+ ] | [
65
+ PrismaObjectRef<PrismaModelTypes>
66
+ ], Nullable extends FieldNullability<Type>, ResolveShape, ResolveReturnShape, Type extends TypeParam extends [
67
+ unknown
68
+ ] ? [
69
+ ObjectRef<Model["Shape"]>
70
+ ] : ObjectRef<Model["Shape"]>, Model extends PrismaModelTypes = PrismaModelTypes & (TypeParam extends [
71
+ keyof Types["PrismaTypes"]
72
+ ] ? Types["PrismaTypes"][TypeParam[0]] : TypeParam extends [
73
+ PrismaObjectRef<PrismaModelTypes>
74
+ ] ? TypeParam[0][typeof prismaModelKey] : TypeParam extends PrismaObjectRef<PrismaModelTypes> ? TypeParam[typeof prismaModelKey] : TypeParam extends keyof Types["PrismaTypes"] ? Types["PrismaTypes"][TypeParam] : never)>(options: PrismaFieldOptions<Types, ParentShape, TypeParam, Model, Type, Args, Nullable, ResolveShape, ResolveReturnShape, Kind>) => FieldRef<ShapeFromTypeParam<Types, Type, Nullable>>;
75
+ prismaConnection: "relay" extends PluginName ? <Type extends PrismaObjectRef<PrismaModelTypes> | keyof Types["PrismaTypes"], Nullable extends boolean, ResolveReturnShape, Args extends InputFieldMap = {}, Model extends PrismaModelTypes = Type extends PrismaObjectRef<infer T> ? T : PrismaModelTypes & Types["PrismaTypes"][Type & keyof Types["PrismaTypes"]]>(options: PrismaConnectionFieldOptions<Types, ParentShape, Type, Model, ObjectRef<Model["Shape"]>, Nullable, Args, ResolveReturnShape, Kind>, ...args: NormalizeArgs<[
76
+ connectionOptions: ConnectionObjectOptions<Types, ObjectRef<Model["Shape"]>, false, false, ResolveReturnShape>,
77
+ edgeOptions: ConnectionEdgeObjectOptions<Types, ObjectRef<Model["Shape"]>, false, ResolveReturnShape>
78
+ ], 0>) => FieldRef<ShapeFromConnection<ConnectionShapeHelper<Types, Model["Shape"], Nullable>>> : "@pothos/plugin-relay is required to use this method";
79
+ prismaFieldWithInput: "prisma" extends PluginName ? <Fields extends Record<string, InputFieldRef<unknown, "InputObject">>, TypeParam extends PrismaObjectRef<PrismaModelTypes> | keyof Types["PrismaTypes"] | [
80
+ keyof Types["PrismaTypes"]
81
+ ] | [
82
+ PrismaObjectRef<PrismaModelTypes>
83
+ ], Type extends TypeParam extends [
84
+ unknown
85
+ ] ? [
86
+ ObjectRef<Model["Shape"]>
87
+ ] : ObjectRef<Model["Shape"]>, ResolveShape, ResolveReturnShape, ArgRequired extends boolean, Args extends Record<string, InputFieldRef<unknown, "Arg">> = {}, Nullable extends FieldNullability<Type> = Types["DefaultFieldNullability"], InputName extends string = "input", Model extends PrismaModelTypes = PrismaModelTypes & (TypeParam extends [
88
+ keyof Types["PrismaTypes"]
89
+ ] ? Types["PrismaTypes"][TypeParam[0]] : TypeParam extends [
90
+ PrismaObjectRef<PrismaModelTypes>
91
+ ] ? TypeParam[0][typeof prismaModelKey] : TypeParam extends PrismaObjectRef<PrismaModelTypes> ? TypeParam[typeof prismaModelKey] : TypeParam extends keyof Types["PrismaTypes"] ? Types["PrismaTypes"][TypeParam] : never)>(options: PrismaFieldWithInputOptions<Types, ParentShape, Kind, Args, Fields, TypeParam, Model, Type, Nullable, InputName, ResolveShape, ResolveReturnShape, boolean extends ArgRequired ? (Types & {
67
92
  WithInputArgRequired: boolean;
68
- })['WithInputArgRequired'] : ArgRequired>) => FieldRef<ShapeFromTypeParam<Types, Type, Nullable>> : '@pothos/plugin-prisma is required to use this method';
93
+ })["WithInputArgRequired"] : ArgRequired>) => FieldRef<ShapeFromTypeParam<Types, Type, Nullable>> : "@pothos/plugin-prisma is required to use this method";
69
94
  }
70
- interface ConnectionFieldOptions<Types extends SchemaTypes, ParentShape, Type extends OutputType<Types>, Nullable extends boolean, EdgeNullability extends FieldNullability<[unknown]>, NodeNullability extends boolean, Args extends InputFieldMap, ResolveReturnShape> {
95
+ interface ConnectionFieldOptions<Types extends SchemaTypes, ParentShape, Type extends OutputType<Types>, Nullable extends boolean, EdgeNullability extends FieldNullability<[
96
+ unknown
97
+ ]>, NodeNullability extends boolean, Args extends InputFieldMap, ResolveReturnShape> {
71
98
  }
72
- interface ConnectionObjectOptions<Types extends SchemaTypes, Type extends OutputType<Types>, EdgeNullability extends FieldNullability<[unknown]>, NodeNullability extends boolean, Resolved> {
99
+ interface ConnectionObjectOptions<Types extends SchemaTypes, Type extends OutputType<Types>, EdgeNullability extends FieldNullability<[
100
+ unknown
101
+ ]>, NodeNullability extends boolean, Resolved> {
73
102
  }
74
103
  interface ConnectionEdgeObjectOptions<Types extends SchemaTypes, Type extends OutputType<Types>, NodeNullability extends boolean, Resolved> {
75
104
  }
@@ -85,10 +114,10 @@ declare global {
85
114
  }
86
115
  interface ScopeAuthContextForAuth<Types extends SchemaTypes, Scopes extends {}> {
87
116
  }
88
- interface PrismaObjectFieldBuilder<Types extends SchemaTypes, Model extends PrismaModelTypes, NeedsResolve extends boolean, Shape extends object = Model['Shape']> extends InternalPrismaObjectFieldBuilder<Types, Model, NeedsResolve, Shape>, RootFieldBuilder<Types, Shape, 'PrismaObject'> {
117
+ interface PrismaObjectFieldBuilder<Types extends SchemaTypes, Model extends PrismaModelTypes, NeedsResolve extends boolean, Shape extends object = Model["Shape"]> extends InternalPrismaObjectFieldBuilder<Types, Model, NeedsResolve, Shape>, RootFieldBuilder<Types, Shape, "PrismaObject"> {
89
118
  }
90
- interface FieldWithInputBaseOptions<Types extends SchemaTypes, Args extends Record<string, InputFieldRef<unknown, 'Arg'>>, Fields extends Record<string, InputFieldRef<unknown, 'InputObject'>>, InputName extends string, ArgRequired extends boolean> {
119
+ interface FieldWithInputBaseOptions<Types extends SchemaTypes, Args extends Record<string, InputFieldRef<unknown, "Arg">>, Fields extends Record<string, InputFieldRef<unknown, "InputObject">>, InputName extends string, ArgRequired extends boolean> {
91
120
  }
92
121
  }
93
122
  }
94
- //# sourceMappingURL=global-types.d.ts.map
123
+ //# sourceMappingURL=global-types.d.ts.map
package/esm/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import './global-types';
2
- import './schema-builder';
1
+ import './global-types.js';
2
+ import './schema-builder.js';
3
3
  import { GraphQLFieldResolver } from 'graphql';
4
4
  import SchemaBuilder, { BasePlugin, BuildCache, PothosOutputFieldConfig, SchemaTypes } from '@pothos/core';
5
- import { PrismaModelTypes } from './types';
6
- import { queryFromInfo } from './util/map-query';
7
- export * from './types';
5
+ import { PrismaModelTypes } from './types.js';
6
+ import { queryFromInfo } from './util/map-query.js';
7
+ export * from './types.js';
8
8
  declare const pluginName: "prisma";
9
9
  export default pluginName;
10
10
  export { queryFromInfo };
@@ -13,6 +13,6 @@ export declare const ObjectFieldBuilder: new <Types extends SchemaTypes, Model e
13
13
  export declare class PrismaPlugin<Types extends SchemaTypes> extends BasePlugin<Types> {
14
14
  constructor(cache: BuildCache<Types>);
15
15
  onOutputFieldConfig(fieldConfig: PothosOutputFieldConfig<Types>): PothosOutputFieldConfig<Types> | null;
16
- wrapResolve(resolver: GraphQLFieldResolver<unknown, Types['Context'], object, unknown>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types['Context'], object>;
16
+ wrapResolve(resolver: GraphQLFieldResolver<unknown, Types["Context"], object, unknown>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object>;
17
17
  }
18
- //# sourceMappingURL=index.d.ts.map
18
+ //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { ObjectRef, SchemaTypes } from '@pothos/core';
2
- import { SelectionState } from './util/selections';
2
+ import { SelectionState } from './util/selections.js';
3
3
  export declare class ModelLoader {
4
4
  model: object;
5
5
  builder: PothosSchemaTypes.SchemaBuilder<never>;
@@ -10,7 +10,8 @@ export declare class ModelLoader {
10
10
  state: SelectionState;
11
11
  }>;
12
12
  constructor(model: object, builder: PothosSchemaTypes.SchemaBuilder<never>, modelName: string, findUnique: (model: Record<string, unknown>, ctx: {}) => unknown);
13
- static forRef<Types extends SchemaTypes>(ref: ObjectRef<unknown>, modelName: string, findUnique: ((model: Record<string, unknown>, ctx: {}) => unknown) | undefined, builder: PothosSchemaTypes.SchemaBuilder<Types>): import("@pothos/core").ContextCache<ModelLoader, object, []>;
13
+ static forRef<Types extends SchemaTypes>(ref: ObjectRef<unknown>, modelName: string, findUnique: ((model: Record<string, unknown>, ctx: {}) => unknown) | undefined, builder: PothosSchemaTypes.SchemaBuilder<Types>): import("@pothos/core").ContextCache<ModelLoader, object, [
14
+ ]>;
14
15
  static getFindUnique(findBy: {
15
16
  name: string | null;
16
17
  fields: string[];
@@ -26,4 +27,4 @@ export declare class ModelLoader {
26
27
  loadSelection(selection: SelectionState, context: object): Promise<Record<string, unknown>>;
27
28
  initLoad(state: SelectionState, context: {}): Promise<Record<string, unknown>>;
28
29
  }
29
- //# sourceMappingURL=model-loader.d.ts.map
30
+ //# sourceMappingURL=model-loader.d.ts.map
package/esm/node-ref.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { PrismaObjectRef } from './object-ref';
2
- import type { PrismaModelTypes } from './types';
1
+ import { PrismaObjectRef } from './object-ref.js';
2
+ import type { PrismaModelTypes } from './types.js';
3
3
  export default class PrismaNodeRef<Model extends PrismaModelTypes, T> extends PrismaObjectRef<Model, T> {
4
4
  }
5
- //# sourceMappingURL=node-ref.d.ts.map
5
+ //# sourceMappingURL=node-ref.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { abstractReturnShapeKey, ObjectRef } from '@pothos/core';
2
- import type { PrismaModelTypes, WithBrand } from './types';
2
+ import type { PrismaModelTypes, WithBrand } from './types.js';
3
3
  export declare const prismaModelKey: unique symbol;
4
4
  export declare class PrismaObjectRef<Model extends PrismaModelTypes, T = {}> extends ObjectRef<T> {
5
5
  [prismaModelKey]: Model;
@@ -9,4 +9,4 @@ export declare class PrismaObjectRef<Model extends PrismaModelTypes, T = {}> ext
9
9
  } : WithBrand<V>;
10
10
  hasBrand(value: unknown): boolean;
11
11
  }
12
- //# sourceMappingURL=object-ref.d.ts.map
12
+ //# sourceMappingURL=object-ref.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { CompatibleTypes, FieldKind, FieldRef, InputFieldMap, NormalizeArgs, ObjectRef, PluginName, SchemaTypes, ShapeFromTypeParam, TypeParam } from '@pothos/core';
2
- import { PrismaObjectRef } from './object-ref';
3
- import { PrismaModelTypes, RelatedConnectionOptions, RelatedFieldOptions, RelationCountOptions, ShapeFromConnection, VariantFieldOptions } from './types';
4
- import { FieldMap } from './util/relation-map';
2
+ import { PrismaObjectRef } from './object-ref.js';
3
+ import { PrismaModelTypes, RelatedConnectionOptions, RelatedFieldOptions, RelationCountOptions, ShapeFromConnection, VariantFieldOptions } from './types.js';
4
+ import { FieldMap } from './util/relation-map.js';
5
5
  declare const RootBuilder: {
6
6
  new <Types extends SchemaTypes, Shape, Kind extends FieldKind>(name: string, builder: PothosSchemaTypes.SchemaBuilder<Types>, kind: FieldKind, graphqlKind: PothosSchemaTypes.PothosKindToGraphQLType[FieldKind]): PothosSchemaTypes.RootFieldBuilder<Types, Shape, Kind>;
7
7
  };
@@ -11,7 +11,7 @@ declare type ContextForAuth<Types extends SchemaTypes, Scopes extends {} = {}> =
11
11
  declare type FieldAuthScopes<Types extends SchemaTypes, Parent, Args extends {} = {}> = PothosSchemaTypes.ScopeAuthFieldAuthScopes<Types, Parent, Args> extends {
12
12
  Scopes: infer T;
13
13
  } ? T : never;
14
- export declare class PrismaObjectFieldBuilder<Types extends SchemaTypes, Model extends PrismaModelTypes, NeedsResolve extends boolean, Shape extends object = Model['Shape']> extends RootBuilder<Types, Shape, 'PrismaObject'> {
14
+ export declare class PrismaObjectFieldBuilder<Types extends SchemaTypes, Model extends PrismaModelTypes, NeedsResolve extends boolean, Shape extends object = Model["Shape"]> extends RootBuilder<Types, Shape, "PrismaObject"> {
15
15
  model: string;
16
16
  prismaFieldMap: FieldMap;
17
17
  exposeBoolean: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], "Boolean", Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, "Boolean", Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
@@ -29,43 +29,73 @@ export declare class PrismaObjectFieldBuilder<Types extends SchemaTypes, Model e
29
29
  exposeString: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], "String", Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, "String", Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
30
30
  description?: string | false | undefined;
31
31
  }) | undefined) => FieldRef<import("@pothos/core").FieldNullability<"String"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never) | null | undefined : "String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never : Nullable extends true ? ("String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never) | null | undefined : "String" extends infer T ? T extends "String" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never, "PrismaObject">;
32
- exposeBooleanList: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], ["Boolean"], Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, ["Boolean"], Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
32
+ exposeBooleanList: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], [
33
+ "Boolean"
34
+ ], Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, [
35
+ "Boolean"
36
+ ], Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
33
37
  description?: string | false | undefined;
34
- }) | undefined) => FieldRef<ShapeFromTypeParam<Types, ["Boolean"], Nullable>, "PrismaObject">;
35
- exposeFloatList: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], ["Float"], Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, ["Float"], Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
38
+ }) | undefined) => FieldRef<ShapeFromTypeParam<Types, [
39
+ "Boolean"
40
+ ], Nullable>, "PrismaObject">;
41
+ exposeFloatList: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], [
42
+ "Float"
43
+ ], Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, [
44
+ "Float"
45
+ ], Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
36
46
  description?: string | false | undefined;
37
- }) | undefined) => FieldRef<ShapeFromTypeParam<Types, ["Float"], Nullable>, "PrismaObject">;
38
- exposeIntList: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], ["Int"], Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, ["Int"], Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
47
+ }) | undefined) => FieldRef<ShapeFromTypeParam<Types, [
48
+ "Float"
49
+ ], Nullable>, "PrismaObject">;
50
+ exposeIntList: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], [
51
+ "Int"
52
+ ], Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, [
53
+ "Int"
54
+ ], Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
39
55
  description?: string | false | undefined;
40
- }) | undefined) => FieldRef<ShapeFromTypeParam<Types, ["Int"], Nullable>, "PrismaObject">;
41
- exposeIDList: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], ["ID"], Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, ["ID"], Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
56
+ }) | undefined) => FieldRef<ShapeFromTypeParam<Types, [
57
+ "Int"
58
+ ], Nullable>, "PrismaObject">;
59
+ exposeIDList: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], [
60
+ "ID"
61
+ ], Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, [
62
+ "ID"
63
+ ], Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
42
64
  description?: string | false | undefined;
43
- }) | undefined) => FieldRef<ShapeFromTypeParam<Types, ["ID"], Nullable>, "PrismaObject">;
44
- exposeStringList: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], ["String"], Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, ["String"], Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
65
+ }) | undefined) => FieldRef<ShapeFromTypeParam<Types, [
66
+ "ID"
67
+ ], Nullable>, "PrismaObject">;
68
+ exposeStringList: <Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], [
69
+ "String"
70
+ ], Nullable>>(name?: Name | undefined, options?: (Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, [
71
+ "String"
72
+ ], Nullable, {}, ResolveReturnShape>, "type" | "description" | "resolve" | "select"> & {
45
73
  description?: string | false | undefined;
46
- }) | undefined) => FieldRef<ShapeFromTypeParam<Types, ["String"], Nullable>, "PrismaObject">;
47
- withAuth: 'scopeAuth' extends PluginName ? <Scopes extends FieldAuthScopes<Types, Shape, Record<string, unknown>>>(scopes: Scopes) => PothosSchemaTypes.PrismaObjectFieldBuilder<Omit<Types, 'Context'> & {
74
+ }) | undefined) => FieldRef<ShapeFromTypeParam<Types, [
75
+ "String"
76
+ ], Nullable>, "PrismaObject">;
77
+ withAuth: "scopeAuth" extends PluginName ? <Scopes extends FieldAuthScopes<Types, Shape, Record<string, unknown>>>(scopes: Scopes) => PothosSchemaTypes.PrismaObjectFieldBuilder<Omit<Types, "Context"> & {
48
78
  Context: ContextForAuth<Types, Scopes>;
49
- }, Model, NeedsResolve, Shape> : '@pothos/plugin-scope-auth is required to use this method';
50
- relatedConnection: 'relay' extends PluginName ? <Field extends Model['ListRelations'], Nullable extends boolean, Args extends InputFieldMap, ResolveReturnShape>(field: Field, options: RelatedConnectionOptions<Types, Model, Field, Nullable, Args, NeedsResolve>, ...args: NormalizeArgs<[
79
+ }, Model, NeedsResolve, Shape> : "@pothos/plugin-scope-auth is required to use this method";
80
+ relatedConnection: "relay" extends PluginName ? <Field extends Model["ListRelations"], Nullable extends boolean, Args extends InputFieldMap, ResolveReturnShape>(field: Field, options: RelatedConnectionOptions<Types, Model, Field, Nullable, Args, NeedsResolve>, ...args: NormalizeArgs<[
51
81
  connectionOptions: PothosSchemaTypes.ConnectionObjectOptions<Types, ObjectRef<Shape>, false, false, ResolveReturnShape>,
52
82
  edgeOptions: PothosSchemaTypes.ConnectionEdgeObjectOptions<Types, ObjectRef<Shape>, false, ResolveReturnShape>
53
- ], 0>) => FieldRef<ShapeFromConnection<PothosSchemaTypes.ConnectionShapeHelper<Types, Shape, Nullable>>> : '@pothos/plugin-relay is required to use this method';
83
+ ], 0>) => FieldRef<ShapeFromConnection<PothosSchemaTypes.ConnectionShapeHelper<Types, Shape, Nullable>>> : "@pothos/plugin-relay is required to use this method";
54
84
  constructor(name: string, builder: PothosSchemaTypes.SchemaBuilder<Types>, model: string, fieldMap: FieldMap);
55
- relation<Field extends Model['RelationName'], Nullable extends boolean, Args extends InputFieldMap, ResolveReturnShape>(name: Field, ...allArgs: NormalizeArgs<[
85
+ relation<Field extends Model["RelationName"], Nullable extends boolean, Args extends InputFieldMap, ResolveReturnShape>(name: Field, ...allArgs: NormalizeArgs<[
56
86
  options: RelatedFieldOptions<Types, Model, Field, Nullable, Args, ResolveReturnShape, NeedsResolve, Shape>
57
- ]>): FieldRef<Model['Relations'][Field]['Shape'], 'Object'>;
58
- relationCount<Field extends Model['RelationName']>(name: Field, ...allArgs: NormalizeArgs<[
59
- options: RelationCountOptions<Types, Shape, NeedsResolve, Model['Relations'][Field]['Types']['Where']>
60
- ]>): FieldRef<number, 'Object'>;
61
- variant<Variant extends Model['Name'] | PrismaObjectRef<Model>, Args extends InputFieldMap, Nullable>(variant: Variant, ...allArgs: NormalizeArgs<[
87
+ ]>): FieldRef<Model["Relations"][Field]["Shape"], "Object">;
88
+ relationCount<Field extends Model["RelationName"]>(name: Field, ...allArgs: NormalizeArgs<[
89
+ options: RelationCountOptions<Types, Shape, NeedsResolve, Model["Relations"][Field]["Types"]["Where"]>
90
+ ]>): FieldRef<number, "Object">;
91
+ variant<Variant extends Model["Name"] | PrismaObjectRef<Model>, Args extends InputFieldMap, Nullable>(variant: Variant, ...allArgs: NormalizeArgs<[
62
92
  options: VariantFieldOptions<Types, Model, Variant extends PrismaObjectRef<Model> ? Variant : PrismaObjectRef<Model>, Args, Nullable, Shape>
63
- ]>): FieldRef<Model['Shape'], 'Object'>;
64
- expose<Type extends TypeParam<Types>, Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model['Shape'], Type, Nullable>>(...args: NormalizeArgs<[
93
+ ]>): FieldRef<Model["Shape"], "Object">;
94
+ expose<Type extends TypeParam<Types>, Nullable extends boolean, ResolveReturnShape, Name extends CompatibleTypes<Types, Model["Shape"], Type, Nullable>>(...args: NormalizeArgs<[
65
95
  name: Name,
66
- options: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, Type, Nullable, {}, ResolveReturnShape>, 'resolve' | 'select'>
96
+ options: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, Type, Nullable, {}, ResolveReturnShape>, "resolve" | "select">
67
97
  ]>): FieldRef<ShapeFromTypeParam<Types, Type, Nullable>, "PrismaObject">;
68
98
  private createExpose;
69
99
  }
70
100
  export {};
71
- //# sourceMappingURL=prisma-field-builder.d.ts.map
101
+ //# sourceMappingURL=prisma-field-builder.d.ts.map
@@ -1,2 +1,2 @@
1
- import './global-types';
2
- //# sourceMappingURL=schema-builder.d.ts.map
1
+ import './global-types.js';
2
+ //# sourceMappingURL=schema-builder.d.ts.map
package/esm/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { FieldNode, GraphQLResolveInfo } from 'graphql';
2
2
  import { FieldKind, FieldMap, FieldNullability, FieldOptionsFromKind, InputFieldMap, InputFieldRef, InputFieldsFromShape, InputShapeFromFields, InterfaceParam, ListResolveValue, MaybePromise, Normalize, ObjectRef, OutputShape, OutputType, SchemaTypes, ShapeFromTypeParam, ShapeWithNullability, typeBrandKey, TypeParam } from '@pothos/core';
3
- import type { PrismaObjectFieldBuilder } from './field-builder';
4
- import { PrismaObjectRef } from './object-ref';
3
+ import type { PrismaObjectFieldBuilder } from './field-builder.js';
4
+ import { PrismaObjectRef } from './object-ref.js';
5
5
  export interface PrismaDelegate {
6
6
  findUniqueOrThrow?: (...args: any[]) => Promise<unknown>;
7
7
  findUnique: (...args: any[]) => Promise<unknown>;
@@ -27,13 +27,13 @@ export interface PrismaModelTypes {
27
27
  }
28
28
  declare type ExtractModel<Types extends SchemaTypes, ParentShape> = ParentShape extends {
29
29
  [prismaModelName]?: infer Name;
30
- } ? Types['PrismaTypes'][Name & keyof Types['PrismaTypes']] extends infer Model ? Model extends PrismaModelTypes ? Model : never : never : never;
30
+ } ? Types["PrismaTypes"][Name & keyof Types["PrismaTypes"]] extends infer Model ? Model extends PrismaModelTypes ? Model : never : never : never;
31
31
  export declare type PrismaObjectFieldOptions<Types extends SchemaTypes, ParentShape, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, Select, ResolveReturnShape> = PothosSchemaTypes.ObjectFieldOptions<Types, unknown extends Select ? ParentShape : ParentShape & ShapeFromSelection<ExtractModel<Types, ParentShape>, {
32
32
  select: Select extends (...args: any[]) => infer S ? S : Select;
33
33
  }>, Type, Nullable, Args, ResolveReturnShape> & {
34
- select?: Select & (ExtractModel<Types, ParentShape>['Select'] | ((args: InputShapeFromFields<Args>, ctx: Types['Context'], nestedSelection: <Selection extends boolean | {}>(selection?: Selection, path?: string[]) => Selection) => ExtractModel<Types, ParentShape>['Select']));
34
+ select?: Select & (ExtractModel<Types, ParentShape>["Select"] | ((args: InputShapeFromFields<Args>, ctx: Types["Context"], nestedSelection: <Selection extends boolean | {}>(selection?: Selection, path?: string[]) => Selection) => ExtractModel<Types, ParentShape>["Select"]));
35
35
  };
36
- declare type PrismaObjectFieldsShape<Types extends SchemaTypes, Model extends PrismaModelTypes, NeedsResolve extends boolean, Shape extends object, Select> = Model['Select'] extends Select ? (t: PrismaObjectFieldBuilder<Types, Model, NeedsResolve, Shape>) => FieldMap : (t: PrismaSelectionFieldBuilder<Types, Model, Shape>) => FieldMap;
36
+ declare type PrismaObjectFieldsShape<Types extends SchemaTypes, Model extends PrismaModelTypes, NeedsResolve extends boolean, Shape extends object, Select> = Model["Select"] extends Select ? (t: PrismaObjectFieldBuilder<Types, Model, NeedsResolve, Shape>) => FieldMap : (t: PrismaSelectionFieldBuilder<Types, Model, Shape>) => FieldMap;
37
37
  declare type PrismaSelectionFieldBuilder<Types extends SchemaTypes, Model extends PrismaModelTypes, Shape extends object> = PrismaObjectFieldBuilder<Types, Model, false, Shape>;
38
38
  interface BaseSelection {
39
39
  include?: unknown;
@@ -42,7 +42,7 @@ interface BaseSelection {
42
42
  export declare type SelectedKeys<T> = {
43
43
  [K in keyof T]: T[K] extends false ? never : K;
44
44
  }[keyof T];
45
- export declare type ShapeFromSelection<Model extends PrismaModelTypes, Selection> = Normalize<Selection extends BaseSelection ? unknown extends Selection['select'] ? Model['Shape'] & RelationShapeFromInclude<Model, Selection['include']> : Pick<Model['Shape'], SelectedKeys<Selection['select']>> & RelationShapeFromInclude<Model, Selection['select']> & ('_count' extends keyof Selection['select'] ? ShapeFromCount<Selection['select']['_count']> : {}) : Model['Shape']>;
45
+ export declare type ShapeFromSelection<Model extends PrismaModelTypes, Selection> = Normalize<Selection extends BaseSelection ? unknown extends Selection["select"] ? Model["Shape"] & RelationShapeFromInclude<Model, Selection["include"]> : Pick<Model["Shape"], SelectedKeys<Selection["select"]>> & RelationShapeFromInclude<Model, Selection["select"]> & ("_count" extends keyof Selection["select"] ? ShapeFromCount<Selection["select"]["_count"]> : {}) : Model["Shape"]>;
46
46
  export declare type ShapeFromCount<Selection> = Selection extends true ? {
47
47
  _count: number;
48
48
  } : Selection extends {
@@ -53,21 +53,21 @@ export declare type ShapeFromCount<Selection> = Selection extends true ? {
53
53
  };
54
54
  } : never;
55
55
  declare type RelationShapeFromInclude<Model extends PrismaModelTypes, Include> = Normalize<{
56
- [K in SelectedKeys<Include> as K extends Model['RelationName'] ? K : never]: K extends keyof Model['Relations'] ? Model['Relations'][K]['Shape'] extends unknown[] ? ShapeFromSelection<Model['Relations'][K]['Types'], Include[K]>[] : ShapeFromSelection<Model['Relations'][K]['Types'], Include[K]> : unknown;
56
+ [K in SelectedKeys<Include> as K extends Model["RelationName"] ? K : never]: K extends keyof Model["Relations"] ? Model["Relations"][K]["Shape"] extends unknown[] ? ShapeFromSelection<Model["Relations"][K]["Types"], Include[K]>[] : ShapeFromSelection<Model["Relations"][K]["Types"], Include[K]> : unknown;
57
57
  }>;
58
- export declare type PrismaObjectTypeOptions<Types extends SchemaTypes, Model extends PrismaModelTypes, Interfaces extends InterfaceParam<Types>[], FindUnique, Include, Select, Shape extends object> = NameOrVariant & Omit<PothosSchemaTypes.ObjectTypeOptions<Types, Shape> | PothosSchemaTypes.ObjectTypeWithInterfaceOptions<Types, Shape, Interfaces>, 'fields' | 'description'> & {
58
+ export declare type PrismaObjectTypeOptions<Types extends SchemaTypes, Model extends PrismaModelTypes, Interfaces extends InterfaceParam<Types>[], FindUnique, Include, Select, Shape extends object> = NameOrVariant & Omit<PothosSchemaTypes.ObjectTypeOptions<Types, Shape> | PothosSchemaTypes.ObjectTypeWithInterfaceOptions<Types, Shape, Interfaces>, "fields" | "description"> & {
59
59
  description?: string | false;
60
60
  fields?: PrismaObjectFieldsShape<Types, Model, FindUnique extends null ? true : false, Shape & (FindUnique extends null ? {} : {
61
- [prismaModelName]?: Model['Name'];
61
+ [prismaModelName]?: Model["Name"];
62
62
  }), Select>;
63
63
  } & ({
64
- include?: Include & Model['Include'];
64
+ include?: Include & Model["Include"];
65
65
  select?: never;
66
- findUnique?: FindUnique & (((parent: Shape, context: Types['Context']) => Model['WhereUnique']) | null);
66
+ findUnique?: FindUnique & (((parent: Shape, context: Types["Context"]) => Model["WhereUnique"]) | null);
67
67
  } | {
68
- select: Model['Select'] & Select;
68
+ select: Model["Select"] & Select;
69
69
  include?: never;
70
- findUnique?: (parent: Shape, context: Types['Context']) => Model['WhereUnique'];
70
+ findUnique?: (parent: Shape, context: Types["Context"]) => Model["WhereUnique"];
71
71
  });
72
72
  declare type NameOrVariant = {
73
73
  name?: never;
@@ -76,111 +76,127 @@ declare type NameOrVariant = {
76
76
  name?: string;
77
77
  variant?: never;
78
78
  };
79
- export declare type PrismaNodeOptions<Types extends SchemaTypes, Model extends PrismaModelTypes, Interfaces extends InterfaceParam<Types>[], Include, Select, Shape extends object, UniqueField> = NameOrVariant & Omit<PothosSchemaTypes.ObjectTypeOptions<Types, Shape> | PothosSchemaTypes.ObjectTypeWithInterfaceOptions<Types, Shape, Interfaces>, 'fields' | 'isTypeOf'> & {
80
- id: Omit<FieldOptionsFromKind<Types, Shape, 'ID', false, {}, 'Object', OutputShape<Types, 'ID'>, MaybePromise<OutputShape<Types, 'ID'>>>, 'args' | 'nullable' | 'resolve' | 'type'> & ({
79
+ export declare type PrismaNodeOptions<Types extends SchemaTypes, Model extends PrismaModelTypes, Interfaces extends InterfaceParam<Types>[], Include, Select, Shape extends object, UniqueField> = NameOrVariant & Omit<PothosSchemaTypes.ObjectTypeOptions<Types, Shape> | PothosSchemaTypes.ObjectTypeWithInterfaceOptions<Types, Shape, Interfaces>, "fields" | "isTypeOf"> & {
80
+ id: Omit<FieldOptionsFromKind<Types, Shape, "ID", false, {}, "Object", OutputShape<Types, "ID">, MaybePromise<OutputShape<Types, "ID">>>, "args" | "nullable" | "resolve" | "type"> & ({
81
81
  field?: never;
82
- resolve: (parent: Shape, context: Types['Context']) => MaybePromise<OutputShape<Types, 'ID'>>;
82
+ resolve: (parent: Shape, context: Types["Context"]) => MaybePromise<OutputShape<Types, "ID">>;
83
83
  } | {
84
84
  resolve?: never;
85
- field: UniqueField extends keyof Model['WhereUnique'] ? UniqueField : keyof Model['WhereUnique'];
85
+ field: UniqueField extends keyof Model["WhereUnique"] ? UniqueField : keyof Model["WhereUnique"];
86
86
  });
87
87
  fields?: PrismaObjectFieldsShape<Types, Model, false, Shape & {
88
- [prismaModelName]?: Model['Name'];
88
+ [prismaModelName]?: Model["Name"];
89
89
  }, Select>;
90
90
  } & (UniqueField extends string ? {
91
- findUnique?: (id: string, context: Types['Context']) => Model['WhereUnique'];
91
+ findUnique?: (id: string, context: Types["Context"]) => Model["WhereUnique"];
92
92
  } : {
93
- findUnique: (id: string, context: Types['Context']) => Model['WhereUnique'];
93
+ findUnique: (id: string, context: Types["Context"]) => Model["WhereUnique"];
94
94
  }) & ({
95
- include?: Include & Model['Include'];
95
+ include?: Include & Model["Include"];
96
96
  select?: never;
97
97
  } | {
98
- select: Model['Select'] & Select;
98
+ select: Model["Select"] & Select;
99
99
  include?: never;
100
100
  });
101
101
  declare type QueryForField<Types extends SchemaTypes, Args extends InputFieldMap, Include> = Include extends {
102
102
  where?: unknown;
103
- } ? Omit<Include, 'include' | 'select'> | ((args: InputShapeFromFields<Args>, ctx: Types['Context']) => Omit<Include, 'include' | 'select'>) : never;
104
- declare type QueryFromRelation<Model extends PrismaModelTypes, Field extends keyof Model['Include']> = Model['Include'][Field] extends infer Include ? Include extends {
103
+ } ? Omit<Include, "include" | "select"> | ((args: InputShapeFromFields<Args>, ctx: Types["Context"]) => Omit<Include, "include" | "select">) : never;
104
+ declare type QueryFromRelation<Model extends PrismaModelTypes, Field extends keyof Model["Include"]> = Model["Include"][Field] extends infer Include ? Include extends {
105
105
  include?: infer I;
106
106
  select?: infer S;
107
107
  } ? {
108
108
  include?: NonNullable<I>;
109
109
  select?: NonNullable<S>;
110
110
  } : never : never;
111
- declare type CursorFromRelation<Model extends PrismaModelTypes, Field extends Model['ListRelations']> = Field extends keyof Model['Include'] ? Model['Include'][Field] extends infer Include ? Include extends {
111
+ declare type CursorFromRelation<Model extends PrismaModelTypes, Field extends Model["ListRelations"]> = Field extends keyof Model["Include"] ? Model["Include"][Field] extends infer Include ? Include extends {
112
112
  cursor?: infer T;
113
113
  } ? keyof T : never : never : never;
114
- declare type RefForRelation<Model extends PrismaModelTypes, Field extends keyof Model['Relations']> = Model['Relations'][Field] extends unknown[] ? [ObjectRef<Model['Relations'][Field]>] : ObjectRef<Model['Relations'][Field]>;
115
- export declare type RelatedFieldOptions<Types extends SchemaTypes, Model extends PrismaModelTypes, Field extends keyof Model['Relations'], Nullable extends boolean, Args extends InputFieldMap, ResolveReturnShape, NeedsResolve extends boolean, Shape> = Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, RefForRelation<Model, Field>, Nullable, Args, ResolveReturnShape>, 'resolve' | 'type' | 'description'> & (NeedsResolve extends false ? {
116
- resolve?: (query: QueryFromRelation<Model, Field & keyof Model['Include']>, parent: Shape, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<ShapeWithNullability<Types, Model['Relations'][Field]['Shape'], Nullable>>;
114
+ declare type RefForRelation<Model extends PrismaModelTypes, Field extends keyof Model["Relations"]> = Model["Relations"][Field] extends unknown[] ? [
115
+ ObjectRef<Model["Relations"][Field]>
116
+ ] : ObjectRef<Model["Relations"][Field]>;
117
+ export declare type RelatedFieldOptions<Types extends SchemaTypes, Model extends PrismaModelTypes, Field extends keyof Model["Relations"], Nullable extends boolean, Args extends InputFieldMap, ResolveReturnShape, NeedsResolve extends boolean, Shape> = Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, RefForRelation<Model, Field>, Nullable, Args, ResolveReturnShape>, "resolve" | "type" | "description"> & (NeedsResolve extends false ? {
118
+ resolve?: (query: QueryFromRelation<Model, Field & keyof Model["Include"]>, parent: Shape, args: InputShapeFromFields<Args>, context: Types["Context"], info: GraphQLResolveInfo) => MaybePromise<ShapeWithNullability<Types, Model["Relations"][Field]["Shape"], Nullable>>;
117
119
  } : {
118
- resolve: (query: QueryFromRelation<Model, Field & keyof Model['Include']>, parent: Shape, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<ShapeWithNullability<Types, Model['Relations'][Field]['Shape'], Nullable>>;
120
+ resolve: (query: QueryFromRelation<Model, Field & keyof Model["Include"]>, parent: Shape, args: InputShapeFromFields<Args>, context: Types["Context"], info: GraphQLResolveInfo) => MaybePromise<ShapeWithNullability<Types, Model["Relations"][Field]["Shape"], Nullable>>;
119
121
  }) & {
120
122
  description?: string | false;
121
- type?: PrismaObjectRef<Model['Relations'][Field]['Types']>;
122
- query?: QueryForField<Types, Args, Model['Include'][Field & keyof Model['Include']]>;
123
+ type?: PrismaObjectRef<Model["Relations"][Field]["Types"]>;
124
+ query?: QueryForField<Types, Args, Model["Include"][Field & keyof Model["Include"]]>;
123
125
  };
124
- export declare type VariantFieldOptions<Types extends SchemaTypes, Model extends PrismaModelTypes, Variant extends PrismaObjectRef<Model>, Args extends InputFieldMap, isNull, Shape> = Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, Variant, unknown extends isNull ? false : true, Args, Model['Shape']>, 'resolve' | 'type'> & {
125
- isNull?: isNull & ((parent: Shape, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<boolean>);
126
+ export declare type VariantFieldOptions<Types extends SchemaTypes, Model extends PrismaModelTypes, Variant extends PrismaObjectRef<Model>, Args extends InputFieldMap, isNull, Shape> = Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, Variant, unknown extends isNull ? false : true, Args, Model["Shape"]>, "resolve" | "type"> & {
127
+ isNull?: isNull & ((parent: Shape, args: InputShapeFromFields<Args>, context: Types["Context"], info: GraphQLResolveInfo) => MaybePromise<boolean>);
126
128
  };
127
- export declare type RelationCountOptions<Types extends SchemaTypes, Shape, NeedsResolve extends boolean, Where> = Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, 'Int', false, {}, number>, 'resolve' | 'type'> & (NeedsResolve extends false ? {
128
- where?: Where | ((args: {}, context: Types['Context']) => Where);
129
- resolve?: (parent: Shape, args: {}, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<number>;
129
+ export declare type RelationCountOptions<Types extends SchemaTypes, Shape, NeedsResolve extends boolean, Where> = Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, "Int", false, {}, number>, "resolve" | "type"> & (NeedsResolve extends false ? {
130
+ where?: Where | ((args: {}, context: Types["Context"]) => Where);
131
+ resolve?: (parent: Shape, args: {}, context: Types["Context"], info: GraphQLResolveInfo) => MaybePromise<number>;
130
132
  } : {
131
- where?: Where | ((args: {}, context: Types['Context']) => Where);
132
- resolve: (parent: Shape, args: {}, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<number>;
133
+ where?: Where | ((args: {}, context: Types["Context"]) => Where);
134
+ resolve: (parent: Shape, args: {}, context: Types["Context"], info: GraphQLResolveInfo) => MaybePromise<number>;
133
135
  });
134
- export declare type PrismaFieldOptions<Types extends SchemaTypes, ParentShape, Type extends PrismaObjectRef<PrismaModelTypes> | keyof Types['PrismaTypes'] | [keyof Types['PrismaTypes']] | [PrismaObjectRef<PrismaModelTypes>], Model extends PrismaModelTypes, Param extends TypeParam<Types>, Args extends InputFieldMap, Nullable extends FieldNullability<Param>, ResolveShape, ResolveReturnShape, Kind extends FieldKind = FieldKind> = FieldOptionsFromKind<Types, ParentShape, Param, Nullable, Args, Kind, ResolveShape, ResolveReturnShape> extends infer FieldOptions ? Omit<FieldOptions, 'resolve' | 'type'> & {
136
+ export declare type PrismaFieldOptions<Types extends SchemaTypes, ParentShape, Type extends PrismaObjectRef<PrismaModelTypes> | keyof Types["PrismaTypes"] | [
137
+ keyof Types["PrismaTypes"]
138
+ ] | [
139
+ PrismaObjectRef<PrismaModelTypes>
140
+ ], Model extends PrismaModelTypes, Param extends TypeParam<Types>, Args extends InputFieldMap, Nullable extends FieldNullability<Param>, ResolveShape, ResolveReturnShape, Kind extends FieldKind = FieldKind> = FieldOptionsFromKind<Types, ParentShape, Param, Nullable, Args, Kind, ResolveShape, ResolveReturnShape> extends infer FieldOptions ? Omit<FieldOptions, "resolve" | "type"> & {
135
141
  type: Type;
136
142
  resolve: FieldOptions extends {
137
143
  resolve?: (parent: infer Parent, ...args: any[]) => unknown;
138
144
  } ? PrismaFieldResolver<Types, Model, Parent, Param, Args, Nullable, ResolveReturnShape> : PrismaFieldResolver<Types, Model, ParentShape, Param, Args, Nullable, ResolveReturnShape>;
139
145
  } : never;
140
- export declare type PrismaFieldWithInputOptions<Types extends SchemaTypes, ParentShape, Kind extends FieldKind, Args extends Record<string, InputFieldRef<unknown, 'Arg'>>, Fields extends Record<string, InputFieldRef<unknown, 'InputObject'>>, Type extends PrismaObjectRef<PrismaModelTypes> | keyof Types['PrismaTypes'] | [keyof Types['PrismaTypes']] | [PrismaObjectRef<PrismaModelTypes>], Model extends PrismaModelTypes, Param extends TypeParam<Types>, Nullable extends FieldNullability<Param>, InputName extends string, ResolveShape, ResolveReturnShape, ArgRequired extends boolean> = Omit<PrismaFieldOptions<Types, ParentShape, Type, Model, Param, {
146
+ export declare type PrismaFieldWithInputOptions<Types extends SchemaTypes, ParentShape, Kind extends FieldKind, Args extends Record<string, InputFieldRef<unknown, "Arg">>, Fields extends Record<string, InputFieldRef<unknown, "InputObject">>, Type extends PrismaObjectRef<PrismaModelTypes> | keyof Types["PrismaTypes"] | [
147
+ keyof Types["PrismaTypes"]
148
+ ] | [
149
+ PrismaObjectRef<PrismaModelTypes>
150
+ ], Model extends PrismaModelTypes, Param extends TypeParam<Types>, Nullable extends FieldNullability<Param>, InputName extends string, ResolveShape, ResolveReturnShape, ArgRequired extends boolean> = Omit<PrismaFieldOptions<Types, ParentShape, Type, Model, Param, {
141
151
  [K in InputName]: InputFieldRef<InputShapeFromFields<Fields> | (true extends ArgRequired ? never : null | undefined)>;
142
- } & Args, Nullable, ResolveShape, ResolveReturnShape, Kind>, 'args'> & PothosSchemaTypes.FieldWithInputBaseOptions<Types, {
152
+ } & Args, Nullable, ResolveShape, ResolveReturnShape, Kind>, "args"> & PothosSchemaTypes.FieldWithInputBaseOptions<Types, {
143
153
  [K in InputName]: InputFieldRef<InputShapeFromFields<Fields> | (true extends ArgRequired ? never : null | undefined)>;
144
154
  } & Args, Fields, InputName, ArgRequired>;
145
155
  export declare type PrismaFieldResolver<Types extends SchemaTypes, Model extends PrismaModelTypes, Parent, Param extends TypeParam<Types>, Args extends InputFieldMap, Nullable extends FieldNullability<Param>, ResolveReturnShape> = (query: {
146
- include?: Model['Include'];
147
- select?: Model['Select'];
148
- }, parent: Parent, args: InputShapeFromFields<Args>, context: Types['Context'], info: GraphQLResolveInfo) => ShapeFromTypeParam<Types, Param, Nullable> extends infer Shape ? [Shape] extends [[readonly (infer Item)[] | null | undefined]] ? ListResolveValue<Shape, Item, ResolveReturnShape> : MaybePromise<Shape> : never;
149
- export declare type PrismaConnectionFieldOptions<Types extends SchemaTypes, ParentShape, Type extends PrismaObjectRef<PrismaModelTypes> | keyof Types['PrismaTypes'], Model extends PrismaModelTypes, Param extends OutputType<Types>, Nullable extends boolean, Args extends InputFieldMap, ResolveReturnShape, Kind extends FieldKind> = Omit<PothosSchemaTypes.ConnectionFieldOptions<Types, ParentShape, Param, Nullable, false, false, Args, ResolveReturnShape>, 'resolve' | 'type'> & Omit<FieldOptionsFromKind<Types, ParentShape, Param, Nullable, (InputFieldMap extends Args ? {} : Args) & InputFieldsFromShape<PothosSchemaTypes.DefaultConnectionArguments>, Kind, ParentShape, ResolveReturnShape>, 'args' | 'resolve' | 'type'> & (InputShapeFromFields<Args> & PothosSchemaTypes.DefaultConnectionArguments extends infer ConnectionArgs ? {
156
+ include?: Model["Include"];
157
+ select?: Model["Select"];
158
+ }, parent: Parent, args: InputShapeFromFields<Args>, context: Types["Context"], info: GraphQLResolveInfo) => ShapeFromTypeParam<Types, Param, Nullable> extends infer Shape ? [
159
+ Shape
160
+ ] extends [
161
+ [
162
+ readonly (infer Item)[] | null | undefined
163
+ ]
164
+ ] ? ListResolveValue<Shape, Item, ResolveReturnShape> : MaybePromise<Shape> : never;
165
+ export declare type PrismaConnectionFieldOptions<Types extends SchemaTypes, ParentShape, Type extends PrismaObjectRef<PrismaModelTypes> | keyof Types["PrismaTypes"], Model extends PrismaModelTypes, Param extends OutputType<Types>, Nullable extends boolean, Args extends InputFieldMap, ResolveReturnShape, Kind extends FieldKind> = Omit<PothosSchemaTypes.ConnectionFieldOptions<Types, ParentShape, Param, Nullable, false, false, Args, ResolveReturnShape>, "resolve" | "type"> & Omit<FieldOptionsFromKind<Types, ParentShape, Param, Nullable, (InputFieldMap extends Args ? {} : Args) & InputFieldsFromShape<PothosSchemaTypes.DefaultConnectionArguments>, Kind, ParentShape, ResolveReturnShape>, "args" | "resolve" | "type"> & (InputShapeFromFields<Args> & PothosSchemaTypes.DefaultConnectionArguments extends infer ConnectionArgs ? {
150
166
  type: Type;
151
- cursor: string & keyof Model['WhereUnique'];
152
- defaultSize?: number | ((args: ConnectionArgs, ctx: Types['Context']) => number);
153
- maxSize?: number | ((args: ConnectionArgs, ctx: Types['Context']) => number);
167
+ cursor: string & keyof Model["WhereUnique"];
168
+ defaultSize?: number | ((args: ConnectionArgs, ctx: Types["Context"]) => number);
169
+ maxSize?: number | ((args: ConnectionArgs, ctx: Types["Context"]) => number);
154
170
  resolve: (query: {
155
- include?: Model['Include'];
156
- cursor?: Model['WhereUnique'];
171
+ include?: Model["Include"];
172
+ cursor?: Model["WhereUnique"];
157
173
  take: number;
158
174
  skip: number;
159
- }, parent: ParentShape, args: ConnectionArgs, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<Model['Shape'][]>;
160
- totalCount?: (parent: ParentShape, args: ConnectionArgs, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<number>;
175
+ }, parent: ParentShape, args: ConnectionArgs, context: Types["Context"], info: GraphQLResolveInfo) => MaybePromise<Model["Shape"][]>;
176
+ totalCount?: (parent: ParentShape, args: ConnectionArgs, context: Types["Context"], info: GraphQLResolveInfo) => MaybePromise<number>;
161
177
  } : never);
162
- export declare type RelatedConnectionOptions<Types extends SchemaTypes, Model extends PrismaModelTypes, Field extends Model['ListRelations'], Nullable extends boolean, Args extends InputFieldMap, NeedsResolve extends boolean> = Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Model['Shape'], ObjectRef<unknown>, Nullable, (InputFieldMap extends Args ? {} : Args) & InputFieldsFromShape<PothosSchemaTypes.DefaultConnectionArguments>, unknown>, 'resolve' | 'type' | 'args' | 'description'> & Omit<PothosSchemaTypes.ConnectionFieldOptions<Types, Model['Shape'], ObjectRef<unknown>, false, false, Nullable, Args, unknown>, 'resolve' | 'type'> & (InputShapeFromFields<Args> & PothosSchemaTypes.DefaultConnectionArguments extends infer ConnectionArgs ? {
178
+ export declare type RelatedConnectionOptions<Types extends SchemaTypes, Model extends PrismaModelTypes, Field extends Model["ListRelations"], Nullable extends boolean, Args extends InputFieldMap, NeedsResolve extends boolean> = Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Model["Shape"], ObjectRef<unknown>, Nullable, (InputFieldMap extends Args ? {} : Args) & InputFieldsFromShape<PothosSchemaTypes.DefaultConnectionArguments>, unknown>, "resolve" | "type" | "args" | "description"> & Omit<PothosSchemaTypes.ConnectionFieldOptions<Types, Model["Shape"], ObjectRef<unknown>, false, false, Nullable, Args, unknown>, "resolve" | "type"> & (InputShapeFromFields<Args> & PothosSchemaTypes.DefaultConnectionArguments extends infer ConnectionArgs ? {
163
179
  description?: string | false;
164
- query?: QueryForField<Types, Args, Model['Include'][Field & keyof Model['Include']]>;
165
- type?: PrismaObjectRef<Model['Relations'][Field]['Types']>;
180
+ query?: QueryForField<Types, Args, Model["Include"][Field & keyof Model["Include"]]>;
181
+ type?: PrismaObjectRef<Model["Relations"][Field]["Types"]>;
166
182
  cursor: CursorFromRelation<Model, Field>;
167
- defaultSize?: number | ((args: ConnectionArgs, ctx: Types['Context']) => number);
168
- maxSize?: number | ((args: ConnectionArgs, ctx: Types['Context']) => number);
183
+ defaultSize?: number | ((args: ConnectionArgs, ctx: Types["Context"]) => number);
184
+ maxSize?: number | ((args: ConnectionArgs, ctx: Types["Context"]) => number);
169
185
  totalCount?: NeedsResolve extends false ? boolean : false;
170
186
  } & (NeedsResolve extends false ? {
171
187
  resolve?: (query: {
172
- include?: Model['Include'];
173
- cursor?: Model['WhereUnique'];
188
+ include?: Model["Include"];
189
+ cursor?: Model["WhereUnique"];
174
190
  take: number;
175
191
  skip: number;
176
- }, parent: Model['Shape'], args: ConnectionArgs, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<Model['Relations'][Field & keyof Model['Relations']]['Shape']>;
192
+ }, parent: Model["Shape"], args: ConnectionArgs, context: Types["Context"], info: GraphQLResolveInfo) => MaybePromise<Model["Relations"][Field & keyof Model["Relations"]]["Shape"]>;
177
193
  } : {
178
194
  resolve: (query: {
179
- include?: Model['Include'];
180
- cursor?: Model['WhereUnique'];
195
+ include?: Model["Include"];
196
+ cursor?: Model["WhereUnique"];
181
197
  take: number;
182
198
  skip: number;
183
- }, parent: Model['Shape'], args: ConnectionArgs, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<Model['Relations'][Field & keyof Model['Relations']]['Shape']>;
199
+ }, parent: Model["Shape"], args: ConnectionArgs, context: Types["Context"], info: GraphQLResolveInfo) => MaybePromise<Model["Relations"][Field & keyof Model["Relations"]]["Shape"]>;
184
200
  }) : never);
185
201
  export declare type WithBrand<T> = T & {
186
202
  [typeBrandKey]: string;
@@ -207,6 +223,6 @@ export interface IndirectInclude {
207
223
  }
208
224
  export declare type ShapeFromConnection<T> = T extends {
209
225
  shape: unknown;
210
- } ? T['shape'] : never;
226
+ } ? T["shape"] : never;
211
227
  export {};
212
- //# sourceMappingURL=types.d.ts.map
228
+ //# sourceMappingURL=types.d.ts.map
@@ -63,4 +63,4 @@ export declare function getCursorParser<Types extends SchemaTypes>(name: string,
63
63
  [x: string]: unknown;
64
64
  };
65
65
  export {};
66
- //# sourceMappingURL=cursors.d.ts.map
66
+ //# sourceMappingURL=cursors.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { ObjectRef, SchemaTypes } from '@pothos/core';
2
- import { PrismaObjectRef } from '../object-ref';
3
- import { PrismaClient, PrismaDelegate, PrismaModelTypes } from '../types';
2
+ import { PrismaObjectRef } from '../object-ref.js';
3
+ import { PrismaClient, PrismaDelegate, PrismaModelTypes } from '../types.js';
4
4
  export declare const refMap: WeakMap<object, Map<string, PrismaObjectRef<PrismaModelTypes, {}>>>;
5
5
  export declare const findUniqueMap: WeakMap<object, Map<ObjectRef<unknown, unknown>, ((args: unknown, ctx: {}) => unknown) | null>>;
6
6
  export declare const includeForRefMap: WeakMap<object, Map<ObjectRef<unknown, unknown>, Record<string, unknown> | null>>;
@@ -21,4 +21,4 @@ export declare function getModel<Types extends SchemaTypes>(name: string, builde
21
21
  documentation?: string | undefined;
22
22
  };
23
23
  export declare function getDelegateFromModel(client: PrismaClient, model: string): PrismaDelegate;
24
- //# sourceMappingURL=datamodel.d.ts.map
24
+ //# sourceMappingURL=datamodel.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export declare function deepEqual(left: unknown, right: unknown, ignore?: Set<string>): boolean;
2
- //# sourceMappingURL=deep-equal.d.ts.map
2
+ //# sourceMappingURL=deep-equal.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import { SchemaTypes } from '@pothos/core';
2
2
  export declare function getFieldDescription<Types extends SchemaTypes>(model: string, builder: PothosSchemaTypes.SchemaBuilder<Types>, fieldName: string, description?: string | false): string | undefined;
3
3
  export declare function getModelDescription<Types extends SchemaTypes>(model: string, builder: PothosSchemaTypes.SchemaBuilder<Types>, description?: string | false): string | undefined;
4
- //# sourceMappingURL=description.d.ts.map
4
+ //# sourceMappingURL=description.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { SchemaTypes } from '@pothos/core';
2
- import { PrismaClient } from '../types';
2
+ import { PrismaClient } from '../types.js';
3
3
  export interface DMMFField {
4
4
  type: string;
5
5
  kind: string;
@@ -27,7 +27,7 @@ interface DMMF {
27
27
  }[];
28
28
  };
29
29
  }
30
- export declare function getClient<Types extends SchemaTypes>(builder: PothosSchemaTypes.SchemaBuilder<Types>, context: Types['Context']): PrismaClient;
30
+ export declare function getClient<Types extends SchemaTypes>(builder: PothosSchemaTypes.SchemaBuilder<Types>, context: Types["Context"]): PrismaClient;
31
31
  export declare function getDMMF<Types extends SchemaTypes>(builder: PothosSchemaTypes.SchemaBuilder<Types>): DMMF;
32
32
  export {};
33
- //# sourceMappingURL=get-client.d.ts.map
33
+ //# sourceMappingURL=get-client.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { GraphQLResolveInfo } from 'graphql';
2
- import { LoaderMappings } from '../types';
3
- export declare function cacheKey(type: string, path: GraphQLResolveInfo['path'], subPath: string[]): string;
2
+ import { LoaderMappings } from '../types.js';
3
+ export declare function cacheKey(type: string, path: GraphQLResolveInfo["path"], subPath: string[]): string;
4
4
  export declare function setLoaderMappings(ctx: object, info: GraphQLResolveInfo, value: LoaderMappings): void;
5
- export declare function getLoaderMapping(ctx: object, path: GraphQLResolveInfo['path'], type: string): LoaderMappings | null;
6
- //# sourceMappingURL=loader-map.d.ts.map
5
+ export declare function getLoaderMapping(ctx: object, path: GraphQLResolveInfo["path"], type: string): LoaderMappings | null;
6
+ //# sourceMappingURL=loader-map.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { GraphQLNamedType, GraphQLResolveInfo } from 'graphql';
2
- import { SelectionMap } from '../types';
3
- import { SelectionState } from './selections';
4
- export declare function queryFromInfo<T extends SelectionMap['select'] | undefined = undefined>({ context, info, typeName, select, path, }: {
2
+ import { SelectionMap } from '../types.js';
3
+ import { SelectionState } from './selections.js';
4
+ export declare function queryFromInfo<T extends SelectionMap["select"] | undefined = undefined>({ context, info, typeName, select, path, }: {
5
5
  context: object;
6
6
  info: GraphQLResolveInfo;
7
7
  typeName?: string;
@@ -14,4 +14,4 @@ export declare function queryFromInfo<T extends SelectionMap['select'] | undefin
14
14
  };
15
15
  export declare function selectionStateFromInfo(context: object, info: GraphQLResolveInfo, typeName?: string): SelectionState;
16
16
  export declare function getIndirectType(type: GraphQLNamedType, info: GraphQLResolveInfo): GraphQLNamedType;
17
- //# sourceMappingURL=map-query.d.ts.map
17
+ //# sourceMappingURL=map-query.d.ts.map
@@ -6,6 +6,7 @@ export interface FieldMap {
6
6
  export declare type RelationMap = Map<string, FieldMap>;
7
7
  export declare const getRelationMap: import("@pothos/core").ContextCache<RelationMap, {
8
8
  datamodel: unknown;
9
- }, []>;
9
+ }, [
10
+ ]>;
10
11
  export declare function createRelationMap({ models }: DMMF.Datamodel): RelationMap;
11
- //# sourceMappingURL=relation-map.d.ts.map
12
+ //# sourceMappingURL=relation-map.d.ts.map
@@ -1,6 +1,6 @@
1
- import { LoaderMappings, SelectionMap } from '../types';
2
- import { FieldMap } from './relation-map';
3
- export declare type SelectionMode = 'select' | 'include';
1
+ import { LoaderMappings, SelectionMap } from '../types.js';
2
+ import { FieldMap } from './relation-map.js';
3
+ export declare type SelectionMode = "select" | "include";
4
4
  export interface SelectionState {
5
5
  fieldMap: FieldMap;
6
6
  query: object;
@@ -17,4 +17,4 @@ export declare function mergeState(state: SelectionState, newState: SelectionSta
17
17
  export declare function createState(fieldMap: FieldMap, mode: SelectionMode, parent?: SelectionState): SelectionState;
18
18
  export declare function mergeSelection(state: SelectionState, { select, include, ...query }: SelectionMap): void;
19
19
  export declare function selectionToQuery(state: SelectionState): SelectionMap;
20
- //# sourceMappingURL=selections.d.ts.map
20
+ //# sourceMappingURL=selections.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pothos/plugin-prisma",
3
- "version": "3.35.2",
3
+ "version": "3.35.4",
4
4
  "description": "A Pothos plugin for more efficient integration with prisma",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./dts/index.d.ts",
@@ -52,12 +52,12 @@
52
52
  "typescript": ">=4.7.2"
53
53
  },
54
54
  "devDependencies": {
55
- "@pothos/core": "3.22.2",
56
- "@pothos/plugin-complexity": "3.11.2",
57
- "@pothos/plugin-errors": "3.8.2",
58
- "@pothos/plugin-relay": "3.28.2",
59
- "@pothos/plugin-simple-objects": "3.6.2",
60
- "@pothos/test-utils": "1.4.1",
55
+ "@pothos/core": "3.22.5",
56
+ "@pothos/plugin-complexity": "3.11.4",
57
+ "@pothos/plugin-errors": "3.8.4",
58
+ "@pothos/plugin-relay": "3.28.4",
59
+ "@pothos/plugin-simple-objects": "3.6.4",
60
+ "@pothos/test-utils": "1.4.3",
61
61
  "@prisma/client": "^4.4.0",
62
62
  "graphql": "16.6.0",
63
63
  "graphql-tag": "^2.12.6",
@@ -72,6 +72,6 @@
72
72
  "build:esm": "cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 && pnpm esm:extensions",
73
73
  "build:dts": "tsc",
74
74
  "esm:extensions": "TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts",
75
- "test": "pnpm vitest --run"
75
+ "test": "pnpm vitest --run --segfault-retry=3"
76
76
  }
77
77
  }