@vantreeseba/drizzle-graphql 5.0.0 → 5.1.0
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/dist/index.cjs +11 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -808,8 +808,8 @@ var innerOrder = new import_graphql4.GraphQLInputObjectType({
|
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
810
|
});
|
|
811
|
-
var resolveGenericFilterName = (column,
|
|
812
|
-
if (
|
|
811
|
+
var resolveGenericFilterName = (column, columnGraphQLType) => {
|
|
812
|
+
if (columnGraphQLType.type === import_graphql_scalars.GraphQLUUID) {
|
|
813
813
|
return "Id";
|
|
814
814
|
}
|
|
815
815
|
if (columnGraphQLType.type === import_graphql4.GraphQLBoolean) {
|
|
@@ -842,11 +842,18 @@ var resolveGenericFilterName = (column, columnName, columnGraphQLType) => {
|
|
|
842
842
|
if (ct === "PgTimestamp" || ct === "PgTimestampString" || ct === "PgDate") {
|
|
843
843
|
return "DateTime";
|
|
844
844
|
}
|
|
845
|
+
if (columnGraphQLType.type === import_graphql4.GraphQLInt) {
|
|
846
|
+
return "Int";
|
|
847
|
+
}
|
|
848
|
+
if (columnGraphQLType.type === import_graphql4.GraphQLFloat) {
|
|
849
|
+
return "Float";
|
|
850
|
+
}
|
|
845
851
|
return "String";
|
|
846
852
|
};
|
|
853
|
+
var FILTERS_WITHOUT_STRING_OPS = /* @__PURE__ */ new Set(["Id", "Int", "Float", "BigInt", "Decimal"]);
|
|
847
854
|
var generateColumnFilterValues = (column, tableName, columnName, cacheCtx) => {
|
|
848
855
|
const columnGraphQLType = drizzleColumnToGraphQLType(column, columnName, tableName, true, false, true);
|
|
849
|
-
const genericName = resolveGenericFilterName(column,
|
|
856
|
+
const genericName = resolveGenericFilterName(column, columnGraphQLType);
|
|
850
857
|
const cached = cacheCtx.genericFilterCache.get(genericName);
|
|
851
858
|
if (cached) {
|
|
852
859
|
return cached;
|
|
@@ -854,7 +861,7 @@ var generateColumnFilterValues = (column, tableName, columnName, cacheCtx) => {
|
|
|
854
861
|
const colType = columnGraphQLType.type;
|
|
855
862
|
const colDesc = columnGraphQLType.description;
|
|
856
863
|
const colArr = new import_graphql4.GraphQLList(new import_graphql4.GraphQLNonNull(colType));
|
|
857
|
-
const omitStringOps = genericName
|
|
864
|
+
const omitStringOps = FILTERS_WITHOUT_STRING_OPS.has(genericName);
|
|
858
865
|
const baseFields = {
|
|
859
866
|
eq: { type: colType, description: colDesc },
|
|
860
867
|
ne: { type: colType, description: colDesc },
|