@@ -9,11 +9,11 @@ exports[`model-generator generates model with all CRUD methods 1`] = `
99import { OrmClient } from "../client";
1010import { QueryBuilder , buildFindManyDocument , buildFindFirstDocument , buildFindOneDocument , buildCreateDocument , buildUpdateByPkDocument , buildDeleteByPkDocument } from "../query-builder";
1111import type { ConnectionResult , FindManyArgs , FindFirstArgs , CreateArgs , UpdateArgs , DeleteArgs , InferSelectResult , StrictSelect } from "../select-types";
12- import type { User , UserWithRelations , UserSelect , UserFilter , UsersOrderBy , CreateUserInput , UpdateUserInput , UserPatch } from "../input-types";
12+ import type { User , UserWithRelations , UserSelect , UserFilter , UserCondition , UsersOrderBy , CreateUserInput , UpdateUserInput , UserPatch } from "../input-types";
1313import { connectionFieldsMap } from "../input-types";
1414export class UserModel {
1515 constructor (private client : OrmClient ) {}
16- findMany <S extends UserSelect >(args : FindManyArgs < S , UserFilter , UsersOrderBy > & {
16+ findMany <S extends UserSelect >(args : FindManyArgs < S , UserFilter , UserCondition , UsersOrderBy > & {
1717 select: S ;
1818 } & StrictSelect < S , UserSelect > ): QueryBuilder < {
1919 users: ConnectionResult < InferSelectResult < UserWithRelations , S>>;
@@ -23,13 +23,14 @@ export class UserModel {
2323 variables
2424 } = buildFindManyDocument (" User" , " users" , args .select , {
2525 where: args ? .where ,
26+ condition : args ? .condition ,
2627 orderBy : args ? .orderBy as string [] | undefined ,
2728 first : args ? .first ,
2829 last : args ? .last ,
2930 after : args ? .after ,
3031 before : args ? .before ,
3132 offset : args ? .offset
32- }, " UserFilter" , " UsersOrderBy" , connectionFieldsMap );
33+ }, " UserFilter" , " UsersOrderBy" , connectionFieldsMap , " UserCondition " );
3334 return new QueryBuilder ({
3435 client: this .client ,
3536 operation: " query" ,
@@ -39,7 +40,7 @@ export class UserModel {
3940 variables
4041 });
4142 }
42- findFirst <S extends UserSelect >(args : FindFirstArgs < S , UserFilter > & {
43+ findFirst <S extends UserSelect >(args : FindFirstArgs < S , UserFilter , UserCondition > & {
4344 select: S ;
4445 } & StrictSelect < S , UserSelect > ): QueryBuilder < {
4546 users: {
@@ -50,8 +51,9 @@ export class UserModel {
5051 document ,
5152 variables
5253 } = buildFindFirstDocument (" User" , " users" , args .select , {
53- where: args ? .where
54- }, " UserFilter" , connectionFieldsMap );
54+ where: args ? .where ,
55+ condition : args ? .condition
56+ }, " UserFilter" , connectionFieldsMap , " UserCondition" );
5557 return new QueryBuilder ({
5658 client: this .client ,
5759 operation: " query" ,
@@ -156,11 +158,11 @@ exports[`model-generator generates model without update/delete when not availabl
156158import { OrmClient } from "../client";
157159import { QueryBuilder , buildFindManyDocument , buildFindFirstDocument , buildFindOneDocument , buildCreateDocument , buildUpdateByPkDocument , buildDeleteByPkDocument } from "../query-builder";
158160import type { ConnectionResult , FindManyArgs , FindFirstArgs , CreateArgs , UpdateArgs , DeleteArgs , InferSelectResult , StrictSelect } from "../select-types";
159- import type { AuditLog , AuditLogWithRelations , AuditLogSelect , AuditLogFilter , AuditLogsOrderBy , CreateAuditLogInput , UpdateAuditLogInput , AuditLogPatch } from "../input-types";
161+ import type { AuditLog , AuditLogWithRelations , AuditLogSelect , AuditLogFilter , AuditLogCondition , AuditLogsOrderBy , CreateAuditLogInput , UpdateAuditLogInput , AuditLogPatch } from "../input-types";
160162import { connectionFieldsMap } from "../input-types";
161163export class AuditLogModel {
162164 constructor (private client : OrmClient ) {}
163- findMany <S extends AuditLogSelect >(args : FindManyArgs < S , AuditLogFilter , AuditLogsOrderBy > & {
165+ findMany <S extends AuditLogSelect >(args : FindManyArgs < S , AuditLogFilter , AuditLogCondition , AuditLogsOrderBy > & {
164166 select: S ;
165167 } & StrictSelect < S , AuditLogSelect > ): QueryBuilder < {
166168 auditLogs: ConnectionResult < InferSelectResult < AuditLogWithRelations , S>>;
@@ -170,13 +172,14 @@ export class AuditLogModel {
170172 variables
171173 } = buildFindManyDocument (" AuditLog" , " auditLogs" , args .select , {
172174 where: args ? .where ,
175+ condition : args ? .condition ,
173176 orderBy : args ? .orderBy as string [] | undefined ,
174177 first : args ? .first ,
175178 last : args ? .last ,
176179 after : args ? .after ,
177180 before : args ? .before ,
178181 offset : args ? .offset
179- }, " AuditLogFilter" , " AuditLogsOrderBy" , connectionFieldsMap );
182+ }, " AuditLogFilter" , " AuditLogsOrderBy" , connectionFieldsMap , " AuditLogCondition " );
180183 return new QueryBuilder ({
181184 client: this .client ,
182185 operation: " query" ,
@@ -186,7 +189,7 @@ export class AuditLogModel {
186189 variables
187190 });
188191 }
189- findFirst <S extends AuditLogSelect >(args : FindFirstArgs < S , AuditLogFilter > & {
192+ findFirst <S extends AuditLogSelect >(args : FindFirstArgs < S , AuditLogFilter , AuditLogCondition > & {
190193 select: S ;
191194 } & StrictSelect < S , AuditLogSelect > ): QueryBuilder < {
192195 auditLogs: {
@@ -197,8 +200,9 @@ export class AuditLogModel {
197200 document ,
198201 variables
199202 } = buildFindFirstDocument (" AuditLog" , " auditLogs" , args .select , {
200- where: args ? .where
201- }, " AuditLogFilter" , connectionFieldsMap );
203+ where: args ? .where ,
204+ condition : args ? .condition
205+ }, " AuditLogFilter" , connectionFieldsMap , " AuditLogCondition" );
202206 return new QueryBuilder ({
203207 client: this .client ,
204208 operation: " query" ,
@@ -259,11 +263,11 @@ exports[`model-generator handles custom query/mutation names 1`] = `
259263import { OrmClient } from "../client";
260264import { QueryBuilder , buildFindManyDocument , buildFindFirstDocument , buildFindOneDocument , buildCreateDocument , buildUpdateByPkDocument , buildDeleteByPkDocument } from "../query-builder";
261265import type { ConnectionResult , FindManyArgs , FindFirstArgs , CreateArgs , UpdateArgs , DeleteArgs , InferSelectResult , StrictSelect } from "../select-types";
262- import type { Organization , OrganizationWithRelations , OrganizationSelect , OrganizationFilter , OrganizationsOrderBy , CreateOrganizationInput , UpdateOrganizationInput , OrganizationPatch } from "../input-types";
266+ import type { Organization , OrganizationWithRelations , OrganizationSelect , OrganizationFilter , OrganizationCondition , OrganizationsOrderBy , CreateOrganizationInput , UpdateOrganizationInput , OrganizationPatch } from "../input-types";
263267import { connectionFieldsMap } from "../input-types";
264268export class OrganizationModel {
265269 constructor (private client : OrmClient ) {}
266- findMany <S extends OrganizationSelect >(args : FindManyArgs < S , OrganizationFilter , OrganizationsOrderBy > & {
270+ findMany <S extends OrganizationSelect >(args : FindManyArgs < S , OrganizationFilter , OrganizationCondition , OrganizationsOrderBy > & {
267271 select: S ;
268272 } & StrictSelect < S , OrganizationSelect > ): QueryBuilder < {
269273 allOrganizations: ConnectionResult < InferSelectResult < OrganizationWithRelations , S>>;
@@ -273,13 +277,14 @@ export class OrganizationModel {
273277 variables
274278 } = buildFindManyDocument (" Organization" , " allOrganizations" , args .select , {
275279 where: args ? .where ,
280+ condition : args ? .condition ,
276281 orderBy : args ? .orderBy as string [] | undefined ,
277282 first : args ? .first ,
278283 last : args ? .last ,
279284 after : args ? .after ,
280285 before : args ? .before ,
281286 offset : args ? .offset
282- }, " OrganizationFilter" , " OrganizationsOrderBy" , connectionFieldsMap );
287+ }, " OrganizationFilter" , " OrganizationsOrderBy" , connectionFieldsMap , " OrganizationCondition " );
283288 return new QueryBuilder ({
284289 client: this .client ,
285290 operation: " query" ,
@@ -289,7 +294,7 @@ export class OrganizationModel {
289294 variables
290295 });
291296 }
292- findFirst <S extends OrganizationSelect >(args : FindFirstArgs < S , OrganizationFilter > & {
297+ findFirst <S extends OrganizationSelect >(args : FindFirstArgs < S , OrganizationFilter , OrganizationCondition > & {
293298 select: S ;
294299 } & StrictSelect < S , OrganizationSelect > ): QueryBuilder < {
295300 allOrganizations: {
@@ -300,8 +305,9 @@ export class OrganizationModel {
300305 document ,
301306 variables
302307 } = buildFindFirstDocument (" Organization" , " allOrganizations" , args .select , {
303- where: args ? .where
304- }, " OrganizationFilter" , connectionFieldsMap );
308+ where: args ? .where ,
309+ condition : args ? .condition
310+ }, " OrganizationFilter" , connectionFieldsMap , " OrganizationCondition" );
305311 return new QueryBuilder ({
306312 client: this .client ,
307313 operation: " query" ,
0 commit comments