Add *_func resolvers for date/time/datetime/timestamp fields

This commit is contained in:
rijkvanzanten
2021-08-14 17:08:12 -04:00
parent 3442faa69e
commit 1d1587530e
2 changed files with 100 additions and 6 deletions

View File

@@ -176,7 +176,7 @@ function getColumnPreprocessor(knex: Knex, schema: SchemaOverview, table: string
let field;
if (fieldNode.type === 'field') {
field = schema.collections[table].fields[fieldNode.name];
field = schema.collections[table].fields[stripFunction(fieldNode.name)];
} else {
field = schema.collections[fieldNode.relation.collection].fields[fieldNode.relation.field];
}
@@ -191,7 +191,7 @@ function getColumnPreprocessor(knex: Knex, schema: SchemaOverview, table: string
return helper.asText(table, field.field);
}
return getColumn(knex, table, field.field, alias);
return getColumn(knex, table, fieldNode.name, alias);
};
}