Skip to content

Commit a484def

Browse files
Boris Dorofeevnodkz
Boris Dorofeev
authored andcommitted
fix: NaN titmestamp from job
1 parent 7b1a955 commit a484def

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/types/job/Job.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { createStateFC } from './Job.state';
33
import { createRepeatOptionsTC } from './Job.opts.repeat';
44
import { SchemaComposer } from 'graphql-compose';
55
import { Options } from '../../definitions';
6+
import { Job } from 'bullmq';
67

78
export function getJobTC(sc: SchemaComposer<any>, opts: Options) {
89
const { typePrefix, jobDataTC = 'JSON!' } = opts;
@@ -14,7 +15,10 @@ export function getJobTC(sc: SchemaComposer<any>, opts: Options) {
1415
data: jobDataTC,
1516
progress: 'Int',
1617
delay: 'Int',
17-
timestamp: 'Date',
18+
timestamp: {
19+
type: 'Date',
20+
resolve: async (job: Job) => (job.timestamp ? job.timestamp : null),
21+
},
1822
attemptsMade: 'Int',
1923
failedReason: 'JSON',
2024
stacktrace: '[String]',

0 commit comments

Comments
 (0)