Skip to content

Commit 2f5c3aa

Browse files
committed
🏗️ build: remove circular dependencies for successful builds
1 parent 7230af0 commit 2f5c3aa

File tree

17 files changed

+281
-285
lines changed

17 files changed

+281
-285
lines changed

lib/abilityBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { lazy } from "./helpers/lazy";
44
import { mergeFilters } from "./helpers/mergeFilters";
55
import { createDistinctValuesFromSQLType } from "./helpers/sqlTypes/distinctValuesFromSQLType";
66
import { tableHelper } from "./helpers/tableHelpers";
7-
import type { Filter } from "./runtimeFiltersPlugin/pluginTypes";
7+
import type { Filter } from "./runtimeFiltersPlugin/filterTypes";
88
import type {
99
DrizzleInstance,
1010
DrizzleQueryFunction,

lib/orderArg.ts renamed to lib/args/orderArg.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { toCamelCase } from "drizzle-orm/casing";
22
import { capitalize } from "es-toolkit";
3-
import { lazy } from "./helpers/lazy";
4-
import { tableHelper } from "./helpers/tableHelpers";
5-
import type { SchemaBuilderType } from "./schemaBuilder";
3+
import { lazy } from "../helpers/lazy";
4+
import { tableHelper } from "../helpers/tableHelpers";
65
import type {
76
DrizzleInstance,
87
DrizzleQueryFunction,
9-
} from "./types/drizzleInstanceType";
8+
} from "../types/drizzleInstanceType";
109
import type {
1110
CustomRumblePothosConfig,
1211
RumbleInput,
13-
} from "./types/rumbleInput";
12+
} from "../types/rumbleInput";
13+
import type { SchemaBuilderType } from "../types/schemaBuilderType";
1414

1515
export type OrderArgImplementerType<
1616
UserContext extends Record<string, any>,
Lines changed: 8 additions & 224 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { toCamelCase } from "drizzle-orm/casing";
22
import { capitalize } from "es-toolkit";
3-
import { type EnumImplementerType, isEnumSchema } from "./enum";
4-
import { mapSQLTypeToGraphQLType } from "./helpers/sqlTypes/mapSQLTypeToTSType";
5-
import type { PossibleSQLType } from "./helpers/sqlTypes/types";
6-
import { tableHelper } from "./helpers/tableHelpers";
7-
import type { SchemaBuilderType } from "./schemaBuilder";
3+
import { type EnumImplementerType, isEnumSchema } from "../enum";
4+
import { mapSQLTypeToGraphQLType } from "../helpers/sqlTypes/mapSQLTypeToTSType";
5+
import type { PossibleSQLType } from "../helpers/sqlTypes/types";
6+
import { tableHelper } from "../helpers/tableHelpers";
87
import type {
98
DrizzleInstance,
109
DrizzleQueryFunction,
11-
} from "./types/drizzleInstanceType";
12-
import { RumbleError } from "./types/rumbleError";
10+
} from "../types/drizzleInstanceType";
11+
import { RumbleError } from "../types/rumbleError";
1312
import type {
1413
CustomRumblePothosConfig,
1514
RumbleInput,
16-
} from "./types/rumbleInput";
15+
} from "../types/rumbleInput";
16+
import type { SchemaBuilderType } from "../types/schemaBuilderType";
1717

1818
// TODO: in general, several of the filter methods should be more
1919
// restrictive in case of explicitly allowed columns
@@ -214,219 +214,3 @@ export const createWhereArgImplementer = <
214214

215215
return whereArgImplementer;
216216
};
217-
218-
export type NumberWhereInputArgument = {
219-
eq?: number;
220-
ne?: number;
221-
gt?: number;
222-
gte?: number;
223-
lt?: number;
224-
lte?: number;
225-
in?: number[];
226-
notIn?: number[];
227-
like?: string;
228-
ilike?: string;
229-
notLike?: string;
230-
notIlike?: string;
231-
isNull?: boolean;
232-
isNotNull?: boolean;
233-
arrayOverlaps?: number[];
234-
arrayContained?: number[];
235-
arrayContains?: number[];
236-
AND?: NumberWhereInputArgument[];
237-
OR?: NumberWhereInputArgument[];
238-
NOT?: NumberWhereInputArgument;
239-
};
240-
241-
export type StringWhereInputArgument = {
242-
eq?: string;
243-
ne?: string;
244-
gt?: string;
245-
gte?: string;
246-
lt?: string;
247-
lte?: string;
248-
in?: string[];
249-
notIn?: string[];
250-
like?: string;
251-
ilike?: string;
252-
notLike?: string;
253-
notIlike?: string;
254-
isNull?: boolean;
255-
isNotNull?: boolean;
256-
arrayOverlaps?: string[];
257-
arrayContained?: string[];
258-
arrayContains?: string[];
259-
AND?: StringWhereInputArgument[];
260-
OR?: StringWhereInputArgument[];
261-
NOT?: StringWhereInputArgument;
262-
};
263-
264-
export type DateWhereInputArgument = {
265-
eq?: Date;
266-
ne?: Date;
267-
gt?: Date;
268-
gte?: Date;
269-
lt?: Date;
270-
lte?: Date;
271-
in?: Date[];
272-
notIn?: Date[];
273-
like?: string;
274-
ilike?: string;
275-
notLike?: string;
276-
notIlike?: string;
277-
isNull?: boolean;
278-
isNotNull?: boolean;
279-
arrayOverlaps?: Date[];
280-
arrayContained?: Date[];
281-
arrayContains?: Date[];
282-
AND?: DateWhereInputArgument[];
283-
OR?: DateWhereInputArgument[];
284-
NOT?: DateWhereInputArgument;
285-
};
286-
287-
export function implementDefaultWhereInputArgs<
288-
UserContext extends Record<string, any>,
289-
DB extends DrizzleInstance,
290-
RequestEvent extends Record<string, any>,
291-
Action extends string,
292-
PothosConfig extends CustomRumblePothosConfig,
293-
T extends SchemaBuilderType<
294-
UserContext,
295-
DB,
296-
RequestEvent,
297-
Action,
298-
PothosConfig
299-
>,
300-
>(schemaBuilder: T) {
301-
const IntWhereInputArgument = schemaBuilder
302-
.inputRef<NumberWhereInputArgument>("IntWhereInputArgument")
303-
.implement({
304-
fields: (t) => ({
305-
eq: t.int(),
306-
ne: t.int(),
307-
gt: t.int(),
308-
gte: t.int(),
309-
lt: t.int(),
310-
lte: t.int(),
311-
in: t.intList(),
312-
notIn: t.intList(),
313-
like: t.string(),
314-
ilike: t.string(),
315-
notLike: t.string(),
316-
notIlike: t.string(),
317-
isNull: t.boolean(),
318-
isNotNull: t.boolean(),
319-
arrayOverlaps: t.intList(),
320-
arrayContained: t.intList(),
321-
arrayContains: t.intList(),
322-
AND: t.field({
323-
type: [IntWhereInputArgument],
324-
}),
325-
OR: t.field({
326-
type: [IntWhereInputArgument],
327-
}),
328-
NOT: t.field({
329-
type: IntWhereInputArgument,
330-
}),
331-
}),
332-
});
333-
334-
const FloatWhereInputArgument = schemaBuilder
335-
.inputRef<NumberWhereInputArgument>("FloatWhereInputArgument")
336-
.implement({
337-
fields: (t) => ({
338-
eq: t.float(),
339-
ne: t.float(),
340-
gt: t.float(),
341-
gte: t.float(),
342-
lt: t.float(),
343-
lte: t.float(),
344-
in: t.floatList(),
345-
notIn: t.floatList(),
346-
like: t.string(),
347-
ilike: t.string(),
348-
notLike: t.string(),
349-
notIlike: t.string(),
350-
isNull: t.boolean(),
351-
isNotNull: t.boolean(),
352-
arrayOverlaps: t.floatList(),
353-
arrayContained: t.floatList(),
354-
arrayContains: t.floatList(),
355-
AND: t.field({
356-
type: [FloatWhereInputArgument],
357-
}),
358-
OR: t.field({
359-
type: [FloatWhereInputArgument],
360-
}),
361-
NOT: t.field({
362-
type: FloatWhereInputArgument,
363-
}),
364-
}),
365-
});
366-
367-
const StringWhereInputArgument = schemaBuilder
368-
.inputRef<StringWhereInputArgument>("StringWhereInputArgument")
369-
.implement({
370-
fields: (t) => ({
371-
eq: t.string(),
372-
ne: t.string(),
373-
gt: t.string(),
374-
gte: t.string(),
375-
lt: t.string(),
376-
lte: t.string(),
377-
in: t.stringList(),
378-
notIn: t.stringList(),
379-
like: t.string(),
380-
ilike: t.string(),
381-
notLike: t.string(),
382-
notIlike: t.string(),
383-
isNull: t.boolean(),
384-
isNotNull: t.boolean(),
385-
arrayOverlaps: t.stringList(),
386-
arrayContained: t.stringList(),
387-
arrayContains: t.stringList(),
388-
AND: t.field({
389-
type: [StringWhereInputArgument],
390-
}),
391-
OR: t.field({
392-
type: [StringWhereInputArgument],
393-
}),
394-
NOT: t.field({
395-
type: StringWhereInputArgument,
396-
}),
397-
}),
398-
});
399-
400-
const DateWhereInputArgument = schemaBuilder
401-
.inputRef<DateWhereInputArgument>("DateWhereInputArgument")
402-
.implement({
403-
fields: (t) => ({
404-
eq: t.field({ type: "Date" }),
405-
ne: t.field({ type: "Date" }),
406-
gt: t.field({ type: "Date" }),
407-
gte: t.field({ type: "Date" }),
408-
lt: t.field({ type: "Date" }),
409-
lte: t.field({ type: "Date" }),
410-
in: t.field({ type: ["Date"] }),
411-
notIn: t.field({ type: ["Date"] }),
412-
like: t.string(),
413-
ilike: t.string(),
414-
notLike: t.string(),
415-
notIlike: t.string(),
416-
isNull: t.boolean(),
417-
isNotNull: t.boolean(),
418-
arrayOverlaps: t.field({ type: ["Date"] }),
419-
arrayContained: t.field({ type: ["Date"] }),
420-
arrayContains: t.field({ type: ["Date"] }),
421-
AND: t.field({
422-
type: [DateWhereInputArgument],
423-
}),
424-
OR: t.field({
425-
type: [DateWhereInputArgument],
426-
}),
427-
NOT: t.field({
428-
type: DateWhereInputArgument,
429-
}),
430-
}),
431-
});
432-
}

0 commit comments

Comments
 (0)