diff --git a/functions/graphql/nexus-typegen.ts b/functions/graphql/nexus-typegen.ts index 96c1137..af20d9f 100644 --- a/functions/graphql/nexus-typegen.ts +++ b/functions/graphql/nexus-typegen.ts @@ -58,6 +58,7 @@ export interface NexusGenObjects { cover_image: string; // String! createdAt: NexusGenScalars['Date']; // Date! deadline: string; // String! + excerpt: string; // String! id: number; // Int! reward_amount: number; // Int! title: string; // String! @@ -107,6 +108,7 @@ export interface NexusGenObjects { answers_count: number; // Int! body: string; // String! createdAt: NexusGenScalars['Date']; // Date! + excerpt: string; // String! id: number; // Int! title: string; // String! votes_count: number; // Int! @@ -115,6 +117,7 @@ export interface NexusGenObjects { body: string; // String! cover_image: string; // String! createdAt: NexusGenScalars['Date']; // Date! + excerpt: string; // String! id: number; // Int! title: string; // String! votes_count: number; // Int! diff --git a/functions/graphql/types/post.js b/functions/graphql/types/post.js index c070b0f..9f0ce3a 100644 --- a/functions/graphql/types/post.js +++ b/functions/graphql/types/post.js @@ -82,6 +82,7 @@ const PostBase = interfaceType({ t.nonNull.string('title'); t.nonNull.date('createdAt'); t.nonNull.string('body'); + t.nonNull.string('excerpt'); t.nonNull.int('votes_count'); }, }) @@ -94,7 +95,6 @@ const Story = objectType({ resolve: () => t.typeName }); t.nonNull.string('cover_image'); - t.nonNull.list.nonNull.field('comments', { type: "PostComment", resolve: (parent) => prisma.story.findUnique({ where: { id: parent.id } }).comments()