@pothos/plugin-prisma 3.44.0 → 3.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -43,6 +43,8 @@ export interface PrismaModelTypes {
43
43
  OrderBy: unknown;
44
44
  Where: {};
45
45
  WhereUnique: {};
46
+ Create: {};
47
+ Update: {};
46
48
  ListRelations: string;
47
49
  RelationName: string;
48
50
  Relations: Record<
@@ -186,7 +186,7 @@ export function serializeID(id: unknown, dataType: string) {
186
186
  }
187
187
  }
188
188
 
189
- export function parseCompositeCursor(fields: string[]) {
189
+ export function parseCompositeCursor(fields: readonly string[]) {
190
190
  return (cursor: unknown) => {
191
191
  const parsed = parsePrismaCursor(cursor) as unknown[];
192
192
 
@@ -275,7 +275,7 @@ export function prismaCursorConnectionQuery({
275
275
  }
276
276
 
277
277
  export function wrapConnectionResult<T extends {}>(
278
- results: T[],
278
+ results: readonly T[],
279
279
  args: PothosSchemaTypes.DefaultConnectionArguments,
280
280
  take: number,
281
281
  cursor: (node: T) => string,
@@ -319,7 +319,12 @@ export function wrapConnectionResult<T extends {}>(
319
319
  export async function resolvePrismaCursorConnection<T extends {}>(
320
320
  options: ResolvePrismaCursorConnectionOptions,
321
321
  cursor: (node: T) => string,
322
- resolve: (query: { include?: {}; cursor?: {}; take: number; skip: number }) => MaybePromise<T[]>,
322
+ resolve: (query: {
323
+ include?: {};
324
+ cursor?: {};
325
+ take: number;
326
+ skip: number;
327
+ }) => MaybePromise<readonly T[]>,
323
328
  ) {
324
329
  const query = prismaCursorConnectionQuery(options);
325
330
  const results = await resolve({
@@ -8,9 +8,13 @@ export interface DMMFField {
8
8
  name: string;
9
9
  isRequired: boolean;
10
10
  isList: boolean;
11
+ hasDefaultValue: boolean;
11
12
  isUnique: boolean;
12
13
  isId: boolean;
13
14
  documentation?: string;
15
+ relationName?: string;
16
+ relationFromFields?: string[];
17
+ isUpdatedAt?: boolean;
14
18
  }
15
19
 
16
20
  interface DMMF {