* split up files * timestamps, scalars and dayjs * lib server directory * move bun types to dev * move storybook dark mode to dev * got timestamps working * fix reference * separate schema into files and add mutations
14 lines
No EOL
325 B
TypeScript
14 lines
No EOL
325 B
TypeScript
import { builder } from '../../builder';
|
|
|
|
export const DateScalar = builder.scalarType('Date', {
|
|
description: 'Date Scalar in ISO format',
|
|
serialize: (date) => {
|
|
return date.toISOString();
|
|
},
|
|
parseValue: (date) => {
|
|
if (typeof date !== 'string') {
|
|
throw new Error('Cyka blyat');
|
|
}
|
|
return new Date(date);
|
|
}
|
|
}); |