From 5706d80bce7dc411045329c5c53a13952d6fdb58 Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Sat, 28 Dec 2024 00:02:45 -0800 Subject: [PATCH] simplify drizzle query by removing offset option --- packages/plugin-drizzle/src/drizzle-field-builder.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/plugin-drizzle/src/drizzle-field-builder.ts b/packages/plugin-drizzle/src/drizzle-field-builder.ts index 3dc414115..7467c6d3f 100644 --- a/packages/plugin-drizzle/src/drizzle-field-builder.ts +++ b/packages/plugin-drizzle/src/drizzle-field-builder.ts @@ -210,7 +210,7 @@ export class DrizzleObjectFieldBuilder< let typeName: string | undefined; const getQuery = (args: PothosSchemaTypes.DefaultConnectionArguments, ctx: {}) => { - const { limit, offset, orderBy, where, ...fieldQuery } = + const { limit, orderBy, where, ...fieldQuery } = (typeof query === 'function' ? query(args, ctx) : query) ?? {}; const { cursorColumns, columns, ...connectionQuery } = drizzleCursorConnectionQuery({ @@ -231,7 +231,6 @@ export class DrizzleObjectFieldBuilder< ...columns, }, limit: Math.abs(limit ?? connectionQuery.limit), - offset: offset ?? connectionQuery.offset, }, cursorColumns, };