hadi
03/08/2019, 2:12 PMJenkins
03/08/2019, 2:15 PMType 'number' is not assignable to type 'DateTimeInput'. Date.now() returns a number.Jenkins
03/08/2019, 2:16 PMhadi
03/08/2019, 2:24 PMhadi
03/08/2019, 2:26 PMhadi
03/08/2019, 2:26 PMJenkins
03/08/2019, 2:27 PMnew Date(Date.now())?Jenkins
03/08/2019, 2:28 PMDateTimeInput look like in your schema?hadi
03/08/2019, 2:40 PM/*
DateTime scalar input type, allowing Date
*/
export type DateTimeInput = Date | string;hadi
03/08/2019, 2:41 PMreturn ctx.prisma.createPost({
title,
content,
author: {
connect: { id: userId },
},
createdAt: new Date(Date.now()),
updatedAt: null
}) but I shouldn't be the one caring about setting those fields, that's my problemhadi
03/08/2019, 2:46 PMMoody Saada
03/08/2019, 2:49 PMJenkins
03/08/2019, 2:58 PMcreatedAt set to DateTime!? If it is - remove the !. Should make the input nullable.hadi
03/08/2019, 3:28 PMJenkins
03/08/2019, 3:52 PMhadi
03/08/2019, 4:30 PMhadi
03/08/2019, 4:31 PMJenkins
03/08/2019, 5:04 PMhadi
03/08/2019, 10:01 PMhadi
03/08/2019, 11:46 PMJenkins
03/09/2019, 6:23 AM