/
post.create.ts
41 lines (29 loc) · 1.05 KB
/
post.create.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { TPostInput } from '@cromwell/core';
import { Field, InputType, Int } from 'type-graphql';
import { CustomDateScalar } from '../objects/custom-date.scalar';
import { BasePageInput } from './base-page.input';
@InputType({ description: 'New Post data' })
export class CreatePost extends BasePageInput implements TPostInput {
@Field(() => String, { nullable: true })
title: string;
@Field((type) => Int)
authorId: number;
@Field(() => String, { nullable: true })
mainImage?: string;
@Field((type) => String, { nullable: true })
readTime?: string | null;
@Field((type) => [Number], { nullable: true })
tagIds?: number[] | null;
@Field(() => String, { nullable: true })
content: string;
@Field(() => String, { nullable: true })
delta: string;
@Field((type) => String, { nullable: true })
excerpt?: string | null;
@Field(() => Boolean, { nullable: true })
published: boolean;
@Field(() => Boolean, { nullable: true })
featured?: boolean;
@Field((type) => CustomDateScalar, { nullable: true })
publishDate?: Date | null;
}