From 5ff83ddc62a34cc8b398fdda930e9bb6bd29f443 Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Fri, 20 May 2022 16:57:07 +0300 Subject: [PATCH] fix: add excerpt to schema --- functions/graphql/nexus-typegen.ts | 3 +++ functions/graphql/types/post.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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()