@pothos/plugin-prisma 3.34.1 → 3.35.1
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 +12 -0
- package/esm/dts/field-builder.d.ts +2 -0
- package/esm/dts/field-builder.d.ts.map +1 -0
- package/esm/dts/generator.d.ts +2 -0
- package/esm/dts/generator.d.ts.map +1 -0
- package/esm/dts/global-types.d.ts +94 -0
- package/esm/dts/global-types.d.ts.map +1 -0
- package/esm/dts/index.d.ts +18 -0
- package/esm/dts/index.d.ts.map +1 -0
- package/esm/dts/model-loader.d.ts +29 -0
- package/esm/dts/model-loader.d.ts.map +1 -0
- package/esm/dts/node-ref.d.ts +5 -0
- package/esm/dts/node-ref.d.ts.map +1 -0
- package/esm/dts/object-ref.d.ts +12 -0
- package/esm/dts/object-ref.d.ts.map +1 -0
- package/esm/dts/prisma-field-builder.d.ts +71 -0
- package/esm/dts/prisma-field-builder.d.ts.map +1 -0
- package/esm/dts/schema-builder.d.ts +2 -0
- package/esm/dts/schema-builder.d.ts.map +1 -0
- package/esm/dts/types.d.ts +212 -0
- package/esm/dts/types.d.ts.map +1 -0
- package/esm/dts/util/cursors.d.ts +66 -0
- package/esm/dts/util/cursors.d.ts.map +1 -0
- package/esm/dts/util/datamodel.d.ts +24 -0
- package/esm/dts/util/datamodel.d.ts.map +1 -0
- package/esm/dts/util/deep-equal.d.ts +2 -0
- package/esm/dts/util/deep-equal.d.ts.map +1 -0
- package/esm/dts/util/description.d.ts +4 -0
- package/esm/dts/util/description.d.ts.map +1 -0
- package/esm/dts/util/get-client.d.ts +33 -0
- package/esm/dts/util/get-client.d.ts.map +1 -0
- package/esm/dts/util/loader-map.d.ts +6 -0
- package/esm/dts/util/loader-map.d.ts.map +1 -0
- package/esm/dts/util/map-query.d.ts +17 -0
- package/esm/dts/util/map-query.d.ts.map +1 -0
- package/esm/dts/util/relation-map.d.ts +11 -0
- package/esm/dts/util/relation-map.d.ts.map +1 -0
- package/esm/dts/util/selections.d.ts +20 -0
- package/esm/dts/util/selections.d.ts.map +1 -0
- package/package.json +19 -15
- package/jest.config.js +0 -6
- package/tsconfig.json +0 -14
- package/tsconfig.type.json +0 -10
- package/tsconfig.type.tsbuildinfo +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.35.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 67531f1e: Create separate typescript definitions for esm files
|
|
8
|
+
|
|
9
|
+
## 3.35.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 11929311: Update type definitions to work with module: "nodeNext"
|
|
14
|
+
|
|
3
15
|
## 3.34.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-builder.d.ts","sourceRoot":"","sources":["../src/field-builder.ts"],"names":[],"mappings":"AAgBA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,94 @@
|
|
|
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 '.';
|
|
7
|
+
declare global {
|
|
8
|
+
export namespace PothosSchemaTypes {
|
|
9
|
+
interface Plugins<Types extends SchemaTypes> {
|
|
10
|
+
prisma: PrismaPlugin<Types>;
|
|
11
|
+
}
|
|
12
|
+
interface SchemaBuilderOptions<Types extends SchemaTypes> {
|
|
13
|
+
prisma: {
|
|
14
|
+
filterConnectionTotalCount?: boolean;
|
|
15
|
+
client: PrismaClient;
|
|
16
|
+
exposeDescriptions?: boolean | {
|
|
17
|
+
models?: boolean;
|
|
18
|
+
fields?: boolean;
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
filterConnectionTotalCount?: boolean;
|
|
22
|
+
client: (ctx: Types['Context']) => PrismaClient;
|
|
23
|
+
dmmf: {
|
|
24
|
+
datamodel: unknown;
|
|
25
|
+
};
|
|
26
|
+
exposeDescriptions?: boolean | {
|
|
27
|
+
models?: boolean;
|
|
28
|
+
fields?: boolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface UserSchemaTypes {
|
|
33
|
+
PrismaTypes: {};
|
|
34
|
+
}
|
|
35
|
+
interface ExtendDefaultTypes<PartialTypes extends Partial<UserSchemaTypes>> {
|
|
36
|
+
PrismaTypes: PartialTypes['PrismaTypes'] & {};
|
|
37
|
+
}
|
|
38
|
+
interface PothosKindToGraphQLType {
|
|
39
|
+
PrismaObject: 'Object';
|
|
40
|
+
}
|
|
41
|
+
interface FieldOptionsByKind<Types extends SchemaTypes, ParentShape, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveShape, ResolveReturnShape> {
|
|
42
|
+
PrismaObject: PrismaObjectFieldOptions<Types, ParentShape, Type, Nullable, Args, ResolveShape, ResolveReturnShape>;
|
|
43
|
+
}
|
|
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, {
|
|
46
|
+
select: Select;
|
|
47
|
+
include: Include;
|
|
48
|
+
}>>) => PrismaObjectRef<Model, ShapeFromSelection<Model, {
|
|
49
|
+
select: Select;
|
|
50
|
+
include: Include;
|
|
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], {
|
|
53
|
+
select: Select;
|
|
54
|
+
include: Include;
|
|
55
|
+
}>, UniqueField>) => PrismaNodeRef<Types['PrismaTypes'][Name] & PrismaModelTypes, ShapeFromSelection<PrismaModelTypes & Types['PrismaTypes'][Name], {
|
|
56
|
+
select: Select;
|
|
57
|
+
include: Include;
|
|
58
|
+
}>> : '@pothos/plugin-relay is required to use this method';
|
|
59
|
+
}
|
|
60
|
+
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 & {
|
|
67
|
+
WithInputArgRequired: boolean;
|
|
68
|
+
})['WithInputArgRequired'] : ArgRequired>) => FieldRef<ShapeFromTypeParam<Types, Type, Nullable>> : '@pothos/plugin-prisma is required to use this method';
|
|
69
|
+
}
|
|
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> {
|
|
71
|
+
}
|
|
72
|
+
interface ConnectionObjectOptions<Types extends SchemaTypes, Type extends OutputType<Types>, EdgeNullability extends FieldNullability<[unknown]>, NodeNullability extends boolean, Resolved> {
|
|
73
|
+
}
|
|
74
|
+
interface ConnectionEdgeObjectOptions<Types extends SchemaTypes, Type extends OutputType<Types>, NodeNullability extends boolean, Resolved> {
|
|
75
|
+
}
|
|
76
|
+
interface DefaultConnectionArguments {
|
|
77
|
+
first?: number | null | undefined;
|
|
78
|
+
last?: number | null | undefined;
|
|
79
|
+
before?: string | null | undefined;
|
|
80
|
+
after?: string | null | undefined;
|
|
81
|
+
}
|
|
82
|
+
interface ConnectionShapeHelper<Types extends SchemaTypes, T, Nullable> {
|
|
83
|
+
}
|
|
84
|
+
interface ScopeAuthFieldAuthScopes<Types extends SchemaTypes, Parent, Args extends {} = {}> {
|
|
85
|
+
}
|
|
86
|
+
interface ScopeAuthContextForAuth<Types extends SchemaTypes, Scopes extends {}> {
|
|
87
|
+
}
|
|
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'> {
|
|
89
|
+
}
|
|
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> {
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=global-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-types.d.ts","sourceRoot":"","sources":["../src/global-types.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,UAAU,EACV,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,aAAa,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,wBAAwB,IAAI,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AACtG,OAAO,EACL,YAAY,EACZ,4BAA4B,EAC5B,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,WAAW,iBAAiB,CAAC;QACjC,UAAiB,OAAO,CAAC,KAAK,SAAS,WAAW;YAChD,MAAM,EAAE,YAAY,CAAC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AAiB,qBAAqB,CAAC,KAAK,SAAS,WAAW,EAAE,CAAC,EAAE,QAAQ;SAAI;QAEjF,UAAiB,wBAAwB,CACvC,KAAK,SAAS,WAAW,EACzB,MAAM,EACN,IAAI,SAAS,EAAE,GAAG,EAAE;SAClB;QACJ,UAAiB,uBAAuB,CAAC,KAAK,SAAS,WAAW,EAAE,MAAM,SAAS,EAAE;SAAI;QAEzF,UAAiB,wBAAwB,CACvC,KAAK,SAAS,WAAW,EACzB,KAAK,SAAS,gBAAgB,EAC9B,YAAY,SAAS,OAAO,EAC5B,KAAK,SAAS,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CACrC,SAAQ,gCAAgC,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,CAAC,EACzE,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC;SAAG;QAErD,UAAiB,yBAAyB,CACxC,KAAK,SAAS,WAAW,EACzB,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EAC1D,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,EACpE,SAAS,SAAS,MAAM,EACxB,WAAW,SAAS,OAAO;SACzB;KACL;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './global-types';
|
|
2
|
+
import './schema-builder';
|
|
3
|
+
import { GraphQLFieldResolver } from 'graphql';
|
|
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';
|
|
8
|
+
declare const pluginName: "prisma";
|
|
9
|
+
export default pluginName;
|
|
10
|
+
export { queryFromInfo };
|
|
11
|
+
export declare type PrismaObjectFieldBuilder<Types extends SchemaTypes, ParentShape> = PothosSchemaTypes.ObjectFieldBuilder<Types, ParentShape>;
|
|
12
|
+
export declare const ObjectFieldBuilder: new <Types extends SchemaTypes, Model extends PrismaModelTypes, NeedsResolve extends boolean, Shape extends object = Model["Shape"]>(name: string, builder: PothosSchemaTypes.SchemaBuilder<Types>) => PothosSchemaTypes.PrismaObjectFieldBuilder<Types, Model, NeedsResolve, Shape>;
|
|
13
|
+
export declare class PrismaPlugin<Types extends SchemaTypes> extends BasePlugin<Types> {
|
|
14
|
+
constructor(cache: BuildCache<Types>);
|
|
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>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AACxB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,aAAa,EAAE,EACpB,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,WAAW,EACZ,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,kBAAkB,CAAC;AAEzE,cAAc,SAAS,CAAC;AAExB,QAAA,MAAM,UAAU,UAAoB,CAAC;AAErC,eAAe,UAAU,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,oBAAY,wBAAwB,CAClC,KAAK,SAAS,WAAW,EACzB,WAAW,IACT,iBAAiB,CAAC,kBAAkB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AAE7D,eAAO,MAAM,kBAAkB,6IAMvB,MAAM,mIAEoE,CAAC;AAEnF,qBAAa,YAAY,CAAC,KAAK,SAAS,WAAW,CAAE,SAAQ,UAAU,CAAC,KAAK,CAAC;gBAChE,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC;IAI3B,mBAAmB,CAC1B,WAAW,EAAE,uBAAuB,CAAC,KAAK,CAAC,GAC1C,uBAAuB,CAAC,KAAK,CAAC,GAAG,IAAI;IA4B/B,WAAW,CAClB,QAAQ,EAAE,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAC1E,WAAW,EAAE,uBAAuB,CAAC,KAAK,CAAC,GAC1C,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CA6C3D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ObjectRef, SchemaTypes } from '@pothos/core';
|
|
2
|
+
import { SelectionState } from './util/selections';
|
|
3
|
+
export declare class ModelLoader {
|
|
4
|
+
model: object;
|
|
5
|
+
builder: PothosSchemaTypes.SchemaBuilder<never>;
|
|
6
|
+
findUnique: (model: Record<string, unknown>, ctx: {}) => unknown;
|
|
7
|
+
modelName: string;
|
|
8
|
+
staged: Set<{
|
|
9
|
+
promise: Promise<Record<string, unknown>>;
|
|
10
|
+
state: SelectionState;
|
|
11
|
+
}>;
|
|
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, []>;
|
|
14
|
+
static getFindUnique(findBy: {
|
|
15
|
+
name: string | null;
|
|
16
|
+
fields: string[];
|
|
17
|
+
} | string): (model: Record<string, unknown>) => {};
|
|
18
|
+
static getDefaultFindBy<Types extends SchemaTypes>(ref: ObjectRef<unknown>, modelName: string, builder: PothosSchemaTypes.SchemaBuilder<Types>): string | {
|
|
19
|
+
name: string | null;
|
|
20
|
+
fields: string[];
|
|
21
|
+
};
|
|
22
|
+
static getDefaultFindUnique<Types extends SchemaTypes>(ref: ObjectRef<unknown>, modelName: string, builder: PothosSchemaTypes.SchemaBuilder<Types>): (model: Record<string, unknown>) => {};
|
|
23
|
+
static getDefaultIDSelection<Types extends SchemaTypes>(ref: ObjectRef<unknown>, modelName: string, builder: PothosSchemaTypes.SchemaBuilder<Types>): Record<string, boolean>;
|
|
24
|
+
static getCursorSelection<Types extends SchemaTypes>(ref: ObjectRef<unknown>, modelName: string, cursor: string, builder: PothosSchemaTypes.SchemaBuilder<Types>): Record<string, boolean>;
|
|
25
|
+
static getFindUniqueForField<Types extends SchemaTypes>(ref: ObjectRef<unknown>, modelName: string, fieldName: string, builder: PothosSchemaTypes.SchemaBuilder<Types>): (model: Record<string, unknown>) => {};
|
|
26
|
+
loadSelection(selection: SelectionState, context: object): Promise<Record<string, unknown>>;
|
|
27
|
+
initLoad(state: SelectionState, context: {}): Promise<Record<string, unknown>>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=model-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-loader.d.ts","sourceRoot":"","sources":["../src/model-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAGL,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,WAAW;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,G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KAAK,SAAS,gBAAgB,EAAE,CAAC,CAAE,SAAQ,eAAe,CAC3F,KAAK,EACL,CAAC,CACF;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { abstractReturnShapeKey, ObjectRef } from '@pothos/core';
|
|
2
|
+
import type { PrismaModelTypes, WithBrand } from './types';
|
|
3
|
+
export declare const prismaModelKey: unique symbol;
|
|
4
|
+
export declare class PrismaObjectRef<Model extends PrismaModelTypes, T = {}> extends ObjectRef<T> {
|
|
5
|
+
[prismaModelKey]: Model;
|
|
6
|
+
[abstractReturnShapeKey]: WithBrand<T>;
|
|
7
|
+
addBrand<V extends T | T[]>(value: V): V extends T[] ? {
|
|
8
|
+
[K in keyof V]: WithBrand<V[K]>;
|
|
9
|
+
} : WithBrand<V>;
|
|
10
|
+
hasBrand(value: unknown): boolean;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=object-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-ref.d.ts","sourceRoot":"","sources":["../src/object-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAiB,SAAS,EAAgB,MAAM,cAAc,CAAC;AAC9F,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,cAAc,eAAsC,CAAC;AAElE,qBAAa,eAAe,CAAC,KAAK,SAAS,gBAAgB,EAAE,CAAC,GAAG,EAAE,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IACvF,CAAC,cAAc,CAAC,EAAG,KAAK,CAAC;IACzB,CAAC,sBAAsB,CAAC,EAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAExC,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EACxB,KAAK,EAAE,CAAC,GACP,CAAC,SAAS,CAAC,EAAE,GAAG;SAAG,CAAC,IAAI,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAAE,GAAG,SAAS,CAAC,CAAC,CAAC;IAYrE,QAAQ,CAAC,KAAK,EAAE,OAAO;CAQxB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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';
|
|
5
|
+
declare const RootBuilder: {
|
|
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
|
+
};
|
|
8
|
+
declare type ContextForAuth<Types extends SchemaTypes, Scopes extends {} = {}> = PothosSchemaTypes.ScopeAuthContextForAuth<Types, Scopes> extends {
|
|
9
|
+
Context: infer T;
|
|
10
|
+
} ? T extends object ? T : object : object;
|
|
11
|
+
declare type FieldAuthScopes<Types extends SchemaTypes, Parent, Args extends {} = {}> = PothosSchemaTypes.ScopeAuthFieldAuthScopes<Types, Parent, Args> extends {
|
|
12
|
+
Scopes: infer T;
|
|
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'> {
|
|
15
|
+
model: string;
|
|
16
|
+
prismaFieldMap: FieldMap;
|
|
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"> & {
|
|
18
|
+
description?: string | false | undefined;
|
|
19
|
+
}) | undefined) => FieldRef<import("@pothos/core").FieldNullability<"Boolean"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never) | null | undefined : "Boolean" extends infer T ? T extends "Boolean" ? 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 ? ("Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never) | null | undefined : "Boolean" extends infer T ? T extends "Boolean" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never, "PrismaObject">;
|
|
20
|
+
exposeFloat: <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"> & {
|
|
21
|
+
description?: string | false | undefined;
|
|
22
|
+
}) | undefined) => FieldRef<import("@pothos/core").FieldNullability<"Float"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never) | null | undefined : "Float" extends infer T ? T extends "Float" ? 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 ? ("Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never) | null | undefined : "Float" extends infer T ? T extends "Float" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never, "PrismaObject">;
|
|
23
|
+
exposeInt: <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"> & {
|
|
24
|
+
description?: string | false | undefined;
|
|
25
|
+
}) | undefined) => FieldRef<import("@pothos/core").FieldNullability<"Int"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never) | null | undefined : "Int" extends infer T ? T extends "Int" ? 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 ? ("Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never) | null | undefined : "Int" extends infer T ? T extends "Int" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never, "PrismaObject">;
|
|
26
|
+
exposeID: <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"> & {
|
|
27
|
+
description?: string | false | undefined;
|
|
28
|
+
}) | undefined) => FieldRef<import("@pothos/core").FieldNullability<"ID"> extends Nullable ? Types["DefaultFieldNullability"] extends true ? ("ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never) | null | undefined : "ID" extends infer T ? T extends "ID" ? 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 ? ("ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never) | null | undefined : "ID" extends infer T ? T extends "ID" ? T extends keyof Types["outputShapes"] ? Types["outputShapes"][T] : T extends import("@pothos/core").BaseEnum ? import("@pothos/core").ValuesFromEnum<T> : never : never : never, "PrismaObject">;
|
|
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
|
+
description?: string | false | undefined;
|
|
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"> & {
|
|
33
|
+
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"> & {
|
|
36
|
+
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"> & {
|
|
39
|
+
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"> & {
|
|
42
|
+
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"> & {
|
|
45
|
+
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'> & {
|
|
48
|
+
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<[
|
|
51
|
+
connectionOptions: PothosSchemaTypes.ConnectionObjectOptions<Types, ObjectRef<Shape>, false, false, ResolveReturnShape>,
|
|
52
|
+
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';
|
|
54
|
+
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<[
|
|
56
|
+
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<[
|
|
62
|
+
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<[
|
|
65
|
+
name: Name,
|
|
66
|
+
options: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, Shape, Type, Nullable, {}, ResolveReturnShape>, 'resolve' | 'select'>
|
|
67
|
+
]>): FieldRef<ShapeFromTypeParam<Types, Type, Nullable>, "PrismaObject">;
|
|
68
|
+
private createExpose;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=prisma-field-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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ACF,CACF,GACA,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IA8B7B,OAAO,CACL,OAAO,SAAS,KAAK,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,EACtD,IAAI,SAAS,aAAa,EAC1B,QAAQ,EAER,OAAO,EAAE,OAAO,EAChB,GAAG,OAAO,EAAE,aAAa,CACvB;QACE,OAAO,EAAE,mBAAmB,CAC1B,KAAK,EACL,KAAK,EACL,OAAO,SAAS,eAAe,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,EACzE,IAAI,EACJ,QAAQ,EACR,KAAK,CACN;KACF,CACF,GACA,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;IA+BrC,MAAM,CACJ,IAAI,SAAS,SAAS,CAAC,KAAK,CAAC,EAC7B,QAAQ,SAAS,OAAO,EACxB,kBAAkB,EAClB,IAAI,SAAS,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAEnE,GAAG,IAAI,EAAE,aAAa,CACpB;QACE,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CACX,iBAAiB,CAAC,kBAAkB,CAClC,KAAK,EACL,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,EAAE,EACF,kBAAkB,CACnB,EACD,SAAS,GAAG,QAAQ,CACrB;KACF,CACF;IAmBH,OAAO,CAAC,YAAY;CAqCrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-builder.d.ts","sourceRoot":"","sources":["../src/schema-builder.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { FieldNode, GraphQLResolveInfo } from 'graphql';
|
|
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';
|
|
5
|
+
export interface PrismaDelegate {
|
|
6
|
+
findUniqueOrThrow?: (...args: any[]) => Promise<unknown>;
|
|
7
|
+
findUnique: (...args: any[]) => Promise<unknown>;
|
|
8
|
+
}
|
|
9
|
+
export declare const prismaModelName: unique symbol;
|
|
10
|
+
export interface PrismaClient {
|
|
11
|
+
$connect: () => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface PrismaModelTypes {
|
|
14
|
+
Name: string;
|
|
15
|
+
Shape: {};
|
|
16
|
+
Include: unknown;
|
|
17
|
+
Select: unknown;
|
|
18
|
+
OrderBy: unknown;
|
|
19
|
+
Where: {};
|
|
20
|
+
WhereUnique: {};
|
|
21
|
+
ListRelations: string;
|
|
22
|
+
RelationName: string;
|
|
23
|
+
Relations: Record<string, {
|
|
24
|
+
Shape: unknown;
|
|
25
|
+
Types: PrismaModelTypes;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
declare type ExtractModel<Types extends SchemaTypes, ParentShape> = ParentShape extends {
|
|
29
|
+
[prismaModelName]?: infer Name;
|
|
30
|
+
} ? Types['PrismaTypes'][Name & keyof Types['PrismaTypes']] extends infer Model ? Model extends PrismaModelTypes ? Model : never : never : never;
|
|
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
|
+
select: Select extends (...args: any[]) => infer S ? S : Select;
|
|
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']));
|
|
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;
|
|
37
|
+
declare type PrismaSelectionFieldBuilder<Types extends SchemaTypes, Model extends PrismaModelTypes, Shape extends object> = PrismaObjectFieldBuilder<Types, Model, false, Shape>;
|
|
38
|
+
interface BaseSelection {
|
|
39
|
+
include?: unknown;
|
|
40
|
+
select?: unknown;
|
|
41
|
+
}
|
|
42
|
+
export declare type SelectedKeys<T> = {
|
|
43
|
+
[K in keyof T]: T[K] extends false ? never : K;
|
|
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']>;
|
|
46
|
+
export declare type ShapeFromCount<Selection> = Selection extends true ? {
|
|
47
|
+
_count: number;
|
|
48
|
+
} : Selection extends {
|
|
49
|
+
select: infer Counts;
|
|
50
|
+
} ? {
|
|
51
|
+
_count: {
|
|
52
|
+
[K in keyof Counts]: number;
|
|
53
|
+
};
|
|
54
|
+
} : never;
|
|
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;
|
|
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'> & {
|
|
59
|
+
description?: string | false;
|
|
60
|
+
fields?: PrismaObjectFieldsShape<Types, Model, FindUnique extends null ? true : false, Shape & (FindUnique extends null ? {} : {
|
|
61
|
+
[prismaModelName]?: Model['Name'];
|
|
62
|
+
}), Select>;
|
|
63
|
+
} & ({
|
|
64
|
+
include?: Include & Model['Include'];
|
|
65
|
+
select?: never;
|
|
66
|
+
findUnique?: FindUnique & (((parent: Shape, context: Types['Context']) => Model['WhereUnique']) | null);
|
|
67
|
+
} | {
|
|
68
|
+
select: Model['Select'] & Select;
|
|
69
|
+
include?: never;
|
|
70
|
+
findUnique?: (parent: Shape, context: Types['Context']) => Model['WhereUnique'];
|
|
71
|
+
});
|
|
72
|
+
declare type NameOrVariant = {
|
|
73
|
+
name?: never;
|
|
74
|
+
variant?: string;
|
|
75
|
+
} | {
|
|
76
|
+
name?: string;
|
|
77
|
+
variant?: never;
|
|
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'> & ({
|
|
81
|
+
field?: never;
|
|
82
|
+
resolve: (parent: Shape, context: Types['Context']) => MaybePromise<OutputShape<Types, 'ID'>>;
|
|
83
|
+
} | {
|
|
84
|
+
resolve?: never;
|
|
85
|
+
field: UniqueField extends keyof Model['WhereUnique'] ? UniqueField : keyof Model['WhereUnique'];
|
|
86
|
+
});
|
|
87
|
+
fields?: PrismaObjectFieldsShape<Types, Model, false, Shape & {
|
|
88
|
+
[prismaModelName]?: Model['Name'];
|
|
89
|
+
}, Select>;
|
|
90
|
+
} & (UniqueField extends string ? {
|
|
91
|
+
findUnique?: (id: string, context: Types['Context']) => Model['WhereUnique'];
|
|
92
|
+
} : {
|
|
93
|
+
findUnique: (id: string, context: Types['Context']) => Model['WhereUnique'];
|
|
94
|
+
}) & ({
|
|
95
|
+
include?: Include & Model['Include'];
|
|
96
|
+
select?: never;
|
|
97
|
+
} | {
|
|
98
|
+
select: Model['Select'] & Select;
|
|
99
|
+
include?: never;
|
|
100
|
+
});
|
|
101
|
+
declare type QueryForField<Types extends SchemaTypes, Args extends InputFieldMap, Include> = Include extends {
|
|
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 {
|
|
105
|
+
include?: infer I;
|
|
106
|
+
select?: infer S;
|
|
107
|
+
} ? {
|
|
108
|
+
include?: NonNullable<I>;
|
|
109
|
+
select?: NonNullable<S>;
|
|
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 {
|
|
112
|
+
cursor?: infer T;
|
|
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>>;
|
|
117
|
+
} : {
|
|
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>>;
|
|
119
|
+
}) & {
|
|
120
|
+
description?: string | false;
|
|
121
|
+
type?: PrismaObjectRef<Model['Relations'][Field]['Types']>;
|
|
122
|
+
query?: QueryForField<Types, Args, Model['Include'][Field & keyof Model['Include']]>;
|
|
123
|
+
};
|
|
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
|
+
};
|
|
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>;
|
|
130
|
+
} : {
|
|
131
|
+
where?: Where | ((args: {}, context: Types['Context']) => Where);
|
|
132
|
+
resolve: (parent: Shape, args: {}, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<number>;
|
|
133
|
+
});
|
|
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'> & {
|
|
135
|
+
type: Type;
|
|
136
|
+
resolve: FieldOptions extends {
|
|
137
|
+
resolve?: (parent: infer Parent, ...args: any[]) => unknown;
|
|
138
|
+
} ? PrismaFieldResolver<Types, Model, Parent, Param, Args, Nullable, ResolveReturnShape> : PrismaFieldResolver<Types, Model, ParentShape, Param, Args, Nullable, ResolveReturnShape>;
|
|
139
|
+
} : 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, {
|
|
141
|
+
[K in InputName]: InputFieldRef<InputShapeFromFields<Fields> | (true extends ArgRequired ? never : null | undefined)>;
|
|
142
|
+
} & Args, Nullable, ResolveShape, ResolveReturnShape, Kind>, 'args'> & PothosSchemaTypes.FieldWithInputBaseOptions<Types, {
|
|
143
|
+
[K in InputName]: InputFieldRef<InputShapeFromFields<Fields> | (true extends ArgRequired ? never : null | undefined)>;
|
|
144
|
+
} & Args, Fields, InputName, ArgRequired>;
|
|
145
|
+
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 ? {
|
|
150
|
+
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);
|
|
154
|
+
resolve: (query: {
|
|
155
|
+
include?: Model['Include'];
|
|
156
|
+
cursor?: Model['WhereUnique'];
|
|
157
|
+
take: number;
|
|
158
|
+
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>;
|
|
161
|
+
} : 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 ? {
|
|
163
|
+
description?: string | false;
|
|
164
|
+
query?: QueryForField<Types, Args, Model['Include'][Field & keyof Model['Include']]>;
|
|
165
|
+
type?: PrismaObjectRef<Model['Relations'][Field]['Types']>;
|
|
166
|
+
cursor: CursorFromRelation<Model, Field>;
|
|
167
|
+
defaultSize?: number | ((args: ConnectionArgs, ctx: Types['Context']) => number);
|
|
168
|
+
maxSize?: number | ((args: ConnectionArgs, ctx: Types['Context']) => number);
|
|
169
|
+
totalCount?: NeedsResolve extends false ? boolean : false;
|
|
170
|
+
} & (NeedsResolve extends false ? {
|
|
171
|
+
resolve?: (query: {
|
|
172
|
+
include?: Model['Include'];
|
|
173
|
+
cursor?: Model['WhereUnique'];
|
|
174
|
+
take: number;
|
|
175
|
+
skip: number;
|
|
176
|
+
}, parent: Model['Shape'], args: ConnectionArgs, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<Model['Relations'][Field & keyof Model['Relations']]['Shape']>;
|
|
177
|
+
} : {
|
|
178
|
+
resolve: (query: {
|
|
179
|
+
include?: Model['Include'];
|
|
180
|
+
cursor?: Model['WhereUnique'];
|
|
181
|
+
take: number;
|
|
182
|
+
skip: number;
|
|
183
|
+
}, parent: Model['Shape'], args: ConnectionArgs, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<Model['Relations'][Field & keyof Model['Relations']]['Shape']>;
|
|
184
|
+
}) : never);
|
|
185
|
+
export declare type WithBrand<T> = T & {
|
|
186
|
+
[typeBrandKey]: string;
|
|
187
|
+
};
|
|
188
|
+
export declare type IncludeMap = Record<string, SelectionMap | boolean>;
|
|
189
|
+
export interface SelectionMap {
|
|
190
|
+
select?: Record<string, SelectionMap | boolean>;
|
|
191
|
+
include?: Record<string, SelectionMap | boolean>;
|
|
192
|
+
where?: {};
|
|
193
|
+
}
|
|
194
|
+
export declare type FieldSelection = Record<string, SelectionMap | boolean> | ((args: object, context: object, mergeNestedSelection: (selection: SelectionMap | boolean | ((args: object, context: object) => SelectionMap), path?: string[] | IndirectInclude) => SelectionMap | boolean, resolveSelection: (path: string[]) => FieldNode | null) => SelectionMap);
|
|
195
|
+
export declare type LoaderMappings = Record<string, {
|
|
196
|
+
field: string;
|
|
197
|
+
type: string;
|
|
198
|
+
mappings: LoaderMappings;
|
|
199
|
+
indirectPath: string[];
|
|
200
|
+
}>;
|
|
201
|
+
export interface IndirectInclude {
|
|
202
|
+
getType: () => string;
|
|
203
|
+
path: {
|
|
204
|
+
type?: string;
|
|
205
|
+
name: string;
|
|
206
|
+
}[];
|
|
207
|
+
}
|
|
208
|
+
export declare type ShapeFromConnection<T> = T extends {
|
|
209
|
+
shape: unknown;
|
|
210
|
+
} ? T['shape'] : never;
|
|
211
|
+
export {};
|
|
212
|
+
//# sourceMappingURL=types.d.ts.map
|