Skip to content

Commit bc7d7a8

Browse files
author
Divyendu Singh
authored
Merge pull request prisma#4449 from prisma/fix-3774
fix(ts-client): lenient input optionals
2 parents 236f7b2 + 3a65210 commit bc7d7a8

12 files changed

+4791
-4623
lines changed

cli/packages/prisma-client-lib/src/codegen/generators/__tests__/__snapshots__/typescript-client.airbnb.test.js.md

Lines changed: 4247 additions & 4099 deletions
Large diffs are not rendered by default.

cli/packages/prisma-client-lib/src/codegen/generators/__tests__/__snapshots__/typescript-client.connection.test.js.md

Lines changed: 83 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Generated by [AVA](https://ava.li).
2323
export type AtLeastOne<T, U = { [K in keyof T]: Pick<T, K> }> = Partial<T> &␊
2424
U[keyof U];␊
2525
26+
export type Maybe<T> = T | undefined | null;␊
27+
2628
export interface Exists {␊
2729
house: (where?: HouseWhereInput) => Promise<boolean>;␊
2830
user: (where?: UserWhereInput) => Promise<boolean>;␊
@@ -156,119 +158,119 @@ Generated by [AVA](https://ava.li).
156158
}␊
157159
158160
export type HouseWhereUniqueInput = AtLeastOne<{␊
159-
id: ID_Input;␊
161+
id: Maybe<ID_Input>;␊
160162
}>;␊
161163
162164
export interface UserUpdateOneRequiredWithoutHouseInput {␊
163-
connect?: UserWhereUniqueInput;␊
165+
connect?: Maybe<UserWhereUniqueInput>;␊
164166
}␊
165167
166168
export interface HouseWhereInput {␊
167-
id?: ID_Input;␊
168-
id_not?: ID_Input;␊
169-
id_in?: ID_Input[] | ID_Input;␊
170-
id_not_in?: ID_Input[] | ID_Input;␊
171-
id_lt?: ID_Input;␊
172-
id_lte?: ID_Input;␊
173-
id_gt?: ID_Input;␊
174-
id_gte?: ID_Input;␊
175-
id_contains?: ID_Input;␊
176-
id_not_contains?: ID_Input;␊
177-
id_starts_with?: ID_Input;␊
178-
id_not_starts_with?: ID_Input;␊
179-
id_ends_with?: ID_Input;␊
180-
id_not_ends_with?: ID_Input;␊
181-
name?: String;␊
182-
name_not?: String;␊
183-
name_in?: String[] | String;␊
184-
name_not_in?: String[] | String;␊
185-
name_lt?: String;␊
186-
name_lte?: String;␊
187-
name_gt?: String;␊
188-
name_gte?: String;␊
189-
name_contains?: String;␊
190-
name_not_contains?: String;␊
191-
name_starts_with?: String;␊
192-
name_not_starts_with?: String;␊
193-
name_ends_with?: String;␊
194-
name_not_ends_with?: String;␊
195-
user?: UserWhereInput;␊
196-
AND?: HouseWhereInput[] | HouseWhereInput;␊
197-
OR?: HouseWhereInput[] | HouseWhereInput;␊
198-
NOT?: HouseWhereInput[] | HouseWhereInput;␊
169+
id?: Maybe<ID_Input>;␊
170+
id_not?: Maybe<ID_Input>;␊
171+
id_in?: Maybe<ID_Input[] | ID_Input>;␊
172+
id_not_in?: Maybe<ID_Input[] | ID_Input>;␊
173+
id_lt?: Maybe<ID_Input>;␊
174+
id_lte?: Maybe<ID_Input>;␊
175+
id_gt?: Maybe<ID_Input>;␊
176+
id_gte?: Maybe<ID_Input>;␊
177+
id_contains?: Maybe<ID_Input>;␊
178+
id_not_contains?: Maybe<ID_Input>;␊
179+
id_starts_with?: Maybe<ID_Input>;␊
180+
id_not_starts_with?: Maybe<ID_Input>;␊
181+
id_ends_with?: Maybe<ID_Input>;␊
182+
id_not_ends_with?: Maybe<ID_Input>;␊
183+
name?: Maybe<String>;␊
184+
name_not?: Maybe<String>;␊
185+
name_in?: Maybe<String[] | String>;␊
186+
name_not_in?: Maybe<String[] | String>;␊
187+
name_lt?: Maybe<String>;␊
188+
name_lte?: Maybe<String>;␊
189+
name_gt?: Maybe<String>;␊
190+
name_gte?: Maybe<String>;␊
191+
name_contains?: Maybe<String>;␊
192+
name_not_contains?: Maybe<String>;␊
193+
name_starts_with?: Maybe<String>;␊
194+
name_not_starts_with?: Maybe<String>;␊
195+
name_ends_with?: Maybe<String>;␊
196+
name_not_ends_with?: Maybe<String>;␊
197+
user?: Maybe<UserWhereInput>;␊
198+
AND?: Maybe<HouseWhereInput[] | HouseWhereInput>;␊
199+
OR?: Maybe<HouseWhereInput[] | HouseWhereInput>;␊
200+
NOT?: Maybe<HouseWhereInput[] | HouseWhereInput>;␊
199201
}␊
200202
201203
export interface UserUpdateInput {␊
202-
house?: HouseUpdateOneRequiredWithoutUserInput;␊
204+
house?: Maybe<HouseUpdateOneRequiredWithoutUserInput>;␊
203205
}␊
204206
205207
export interface HouseUpdateInput {␊
206-
name?: String;␊
207-
user?: UserUpdateOneRequiredWithoutHouseInput;␊
208+
name?: Maybe<String>;␊
209+
user?: Maybe<UserUpdateOneRequiredWithoutHouseInput>;␊
208210
}␊
209211
210212
export interface HouseCreateWithoutUserInput {␊
211213
name: String;␊
212214
}␊
213215
214216
export interface HouseUpdateManyMutationInput {␊
215-
name?: String;␊
217+
name?: Maybe<String>;␊
216218
}␊
217219
218220
export interface HouseCreateOneWithoutUserInput {␊
219-
create?: HouseCreateWithoutUserInput;␊
220-
connect?: HouseWhereUniqueInput;␊
221+
create?: Maybe<HouseCreateWithoutUserInput>;␊
222+
connect?: Maybe<HouseWhereUniqueInput>;␊
221223
}␊
222224
223225
export interface HouseSubscriptionWhereInput {␊
224-
mutation_in?: MutationType[] | MutationType;␊
225-
updatedFields_contains?: String;␊
226-
updatedFields_contains_every?: String[] | String;␊
227-
updatedFields_contains_some?: String[] | String;␊
228-
node?: HouseWhereInput;␊
229-
AND?: HouseSubscriptionWhereInput[] | HouseSubscriptionWhereInput;␊
230-
OR?: HouseSubscriptionWhereInput[] | HouseSubscriptionWhereInput;␊
231-
NOT?: HouseSubscriptionWhereInput[] | HouseSubscriptionWhereInput;␊
226+
mutation_in?: Maybe<MutationType[] | MutationType>;␊
227+
updatedFields_contains?: Maybe<String>;␊
228+
updatedFields_contains_every?: Maybe<String[] | String>;␊
229+
updatedFields_contains_some?: Maybe<String[] | String>;␊
230+
node?: Maybe<HouseWhereInput>;␊
231+
AND?: Maybe<HouseSubscriptionWhereInput[] | HouseSubscriptionWhereInput>;␊
232+
OR?: Maybe<HouseSubscriptionWhereInput[] | HouseSubscriptionWhereInput>;␊
233+
NOT?: Maybe<HouseSubscriptionWhereInput[] | HouseSubscriptionWhereInput>;␊
232234
}␊
233235
234236
export interface HouseUpdateWithoutUserDataInput {␊
235-
name?: String;␊
237+
name?: Maybe<String>;␊
236238
}␊
237239
238240
export interface UserCreateOneWithoutHouseInput {␊
239-
connect?: UserWhereUniqueInput;␊
241+
connect?: Maybe<UserWhereUniqueInput>;␊
240242
}␊
241243
242244
export interface UserWhereInput {␊
243-
id?: ID_Input;␊
244-
id_not?: ID_Input;␊
245-
id_in?: ID_Input[] | ID_Input;␊
246-
id_not_in?: ID_Input[] | ID_Input;␊
247-
id_lt?: ID_Input;␊
248-
id_lte?: ID_Input;␊
249-
id_gt?: ID_Input;␊
250-
id_gte?: ID_Input;␊
251-
id_contains?: ID_Input;␊
252-
id_not_contains?: ID_Input;␊
253-
id_starts_with?: ID_Input;␊
254-
id_not_starts_with?: ID_Input;␊
255-
id_ends_with?: ID_Input;␊
256-
id_not_ends_with?: ID_Input;␊
257-
house?: HouseWhereInput;␊
258-
AND?: UserWhereInput[] | UserWhereInput;␊
259-
OR?: UserWhereInput[] | UserWhereInput;␊
260-
NOT?: UserWhereInput[] | UserWhereInput;␊
245+
id?: Maybe<ID_Input>;␊
246+
id_not?: Maybe<ID_Input>;␊
247+
id_in?: Maybe<ID_Input[] | ID_Input>;␊
248+
id_not_in?: Maybe<ID_Input[] | ID_Input>;␊
249+
id_lt?: Maybe<ID_Input>;␊
250+
id_lte?: Maybe<ID_Input>;␊
251+
id_gt?: Maybe<ID_Input>;␊
252+
id_gte?: Maybe<ID_Input>;␊
253+
id_contains?: Maybe<ID_Input>;␊
254+
id_not_contains?: Maybe<ID_Input>;␊
255+
id_starts_with?: Maybe<ID_Input>;␊
256+
id_not_starts_with?: Maybe<ID_Input>;␊
257+
id_ends_with?: Maybe<ID_Input>;␊
258+
id_not_ends_with?: Maybe<ID_Input>;␊
259+
house?: Maybe<HouseWhereInput>;␊
260+
AND?: Maybe<UserWhereInput[] | UserWhereInput>;␊
261+
OR?: Maybe<UserWhereInput[] | UserWhereInput>;␊
262+
NOT?: Maybe<UserWhereInput[] | UserWhereInput>;␊
261263
}␊
262264
263265
export interface UserCreateInput {␊
264266
house: HouseCreateOneWithoutUserInput;␊
265267
}␊
266268
267269
export interface HouseUpdateOneRequiredWithoutUserInput {␊
268-
create?: HouseCreateWithoutUserInput;␊
269-
update?: HouseUpdateWithoutUserDataInput;␊
270-
upsert?: HouseUpsertWithoutUserInput;␊
271-
connect?: HouseWhereUniqueInput;␊
270+
create?: Maybe<HouseCreateWithoutUserInput>;␊
271+
update?: Maybe<HouseUpdateWithoutUserDataInput>;␊
272+
upsert?: Maybe<HouseUpsertWithoutUserInput>;␊
273+
connect?: Maybe<HouseWhereUniqueInput>;␊
272274
}␊
273275
274276
export interface HouseUpsertWithoutUserInput {␊
@@ -277,18 +279,18 @@ Generated by [AVA](https://ava.li).
277279
}␊
278280
279281
export interface UserSubscriptionWhereInput {␊
280-
mutation_in?: MutationType[] | MutationType;␊
281-
updatedFields_contains?: String;␊
282-
updatedFields_contains_every?: String[] | String;␊
283-
updatedFields_contains_some?: String[] | String;␊
284-
node?: UserWhereInput;␊
285-
AND?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput;␊
286-
OR?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput;␊
287-
NOT?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput;␊
282+
mutation_in?: Maybe<MutationType[] | MutationType>;␊
283+
updatedFields_contains?: Maybe<String>;␊
284+
updatedFields_contains_every?: Maybe<String[] | String>;␊
285+
updatedFields_contains_some?: Maybe<String[] | String>;␊
286+
node?: Maybe<UserWhereInput>;␊
287+
AND?: Maybe<UserSubscriptionWhereInput[] | UserSubscriptionWhereInput>;␊
288+
OR?: Maybe<UserSubscriptionWhereInput[] | UserSubscriptionWhereInput>;␊
289+
NOT?: Maybe<UserSubscriptionWhereInput[] | UserSubscriptionWhereInput>;␊
288290
}␊
289291
290292
export type UserWhereUniqueInput = AtLeastOne<{␊
291-
id: ID_Input;␊
293+
id: Maybe<ID_Input>;␊
292294
}>;␊
293295
294296
export interface NodeNode {␊

0 commit comments

Comments
 (0)