1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.GraphQLISODateTime = void 0;
|
4 | const graphql_1 = require("graphql");
|
5 | exports.GraphQLISODateTime = new graphql_1.GraphQLScalarType({
|
6 | name: 'DateTime',
|
7 | description: 'A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.',
|
8 | parseValue(value) {
|
9 | return new Date(value);
|
10 | },
|
11 | serialize(value) {
|
12 | return value instanceof Date ? value.toISOString() : null;
|
13 | },
|
14 | parseLiteral(ast) {
|
15 | return ast.kind === graphql_1.Kind.STRING ? new Date(ast.value) : null;
|
16 | },
|
17 | });
|