rads-db 3.2.39 → 3.2.40
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/integrations/node.cjs +5 -2
- package/integrations/node.mjs +6 -3
- package/package.json +1 -1
package/integrations/node.cjs
CHANGED
|
@@ -216,9 +216,12 @@ function getWhereFieldsFor(schema, type, fieldKey) {
|
|
|
216
216
|
if (isArray) {
|
|
217
217
|
const arrayWhereFields = [`${name}_isEmpty?: boolean`];
|
|
218
218
|
if (!isRequired) arrayWhereFields.push(`${name}_isNull?: boolean`);
|
|
219
|
-
if (isPrimitive
|
|
219
|
+
if (isPrimitive) {
|
|
220
220
|
return [`${name}_arrayContains?: ${fieldTypeName}`, ...arrayWhereFields];
|
|
221
221
|
}
|
|
222
|
+
if (isEnum) {
|
|
223
|
+
return [`${name}_arrayContains?: string`, ...arrayWhereFields];
|
|
224
|
+
}
|
|
222
225
|
if (isRelation) {
|
|
223
226
|
return [`${name}_some?: ${getRelationWhereType()}`, ...arrayWhereFields];
|
|
224
227
|
}
|
|
@@ -239,7 +242,7 @@ function getWhereFieldsFor(schema, type, fieldKey) {
|
|
|
239
242
|
return [`${name}?: ${fieldTypeName}_Where`, ...commonWhereFields];
|
|
240
243
|
}
|
|
241
244
|
if (isEnum) {
|
|
242
|
-
return [`${name}?:
|
|
245
|
+
return [`${name}?: string`, `${name}_in?: string[]`, ...getWhereFieldsForString(fieldKey), ...commonWhereFields];
|
|
243
246
|
}
|
|
244
247
|
if (isPrimitive) {
|
|
245
248
|
return [`${name}?: ${fieldTypeName}`, `${name}_in?: ${fieldTypeName}[]`, ...getWhereFieldsForPrimitive(schema, type, fieldKey), ...commonWhereFields];
|
package/integrations/node.mjs
CHANGED
|
@@ -223,9 +223,12 @@ function getWhereFieldsFor(schema, type, fieldKey) {
|
|
|
223
223
|
if (isArray) {
|
|
224
224
|
const arrayWhereFields = [`${name}_isEmpty?: boolean`];
|
|
225
225
|
if (!isRequired) arrayWhereFields.push(`${name}_isNull?: boolean`);
|
|
226
|
-
if (isPrimitive
|
|
226
|
+
if (isPrimitive) {
|
|
227
227
|
return [`${name}_arrayContains?: ${fieldTypeName}`, ...arrayWhereFields];
|
|
228
228
|
}
|
|
229
|
+
if (isEnum) {
|
|
230
|
+
return [`${name}_arrayContains?: string`, ...arrayWhereFields];
|
|
231
|
+
}
|
|
229
232
|
if (isRelation) {
|
|
230
233
|
return [`${name}_some?: ${getRelationWhereType()}`, ...arrayWhereFields];
|
|
231
234
|
}
|
|
@@ -251,8 +254,8 @@ function getWhereFieldsFor(schema, type, fieldKey) {
|
|
|
251
254
|
}
|
|
252
255
|
if (isEnum) {
|
|
253
256
|
return [
|
|
254
|
-
`${name}?:
|
|
255
|
-
`${name}_in?:
|
|
257
|
+
`${name}?: string`,
|
|
258
|
+
`${name}_in?: string[]`,
|
|
256
259
|
...getWhereFieldsForString(fieldKey),
|
|
257
260
|
...commonWhereFields
|
|
258
261
|
];
|