diff --git a/src/Graphql/graphql.builder.ts b/src/Graphql/graphql.builder.ts index 311a600..0034ea9 100644 --- a/src/Graphql/graphql.builder.ts +++ b/src/Graphql/graphql.builder.ts @@ -130,28 +130,24 @@ export class Builder extends SchemaBuilder { this.generator = new PrismaCrudGenerator(this) this.scalarType('DateTime', { serialize: (value) => { - // Serialize outgoing DateTime to ISO string if (typeof value === 'string') { return value } if (typeof value === 'object' && value !== null && 'toISO' in value) { return value } - // if value = Date, convert to DateTime if (value instanceof Date) { return DateTimeUtils.toIsoString(DateTimeUtils.fromDate(value)) } throw new Error('Invalid DateTime') }, parseValue: (value) => { - // Parse incoming ISO string to Luxon DateTime if (typeof value === 'string') { return DateTimeUtils.fromIsoString(value) } throw new Error('Invalid DateTime') }, parseLiteral: (ast) => { - // parse string to DateTime if (ast.kind === Kind.STRING) { return DateTimeUtils.fromIsoString(ast.value) }