From a0d00743cbbdb77b27c1a3d5711407ffed5befac Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 20 Aug 2022 21:39:51 +0200 Subject: refactor(types): move and rename GraphQL types The api file in services was not really readable. So I move the types and I also rewrite a little the fetch function. I also rename most of the type to avoid conflict with preexisting types (like Node) and to keep consistency. --- src/components/templates/page/page-layout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/templates') diff --git a/src/components/templates/page/page-layout.tsx b/src/components/templates/page/page-layout.tsx index f96666e..d53f53d 100644 --- a/src/components/templates/page/page-layout.tsx +++ b/src/components/templates/page/page-layout.tsx @@ -18,8 +18,8 @@ import CommentsList, { type CommentsListProps, } from '@components/organisms/layout/comments-list'; import TableOfContents from '@components/organisms/widgets/table-of-contents'; -import { type SendCommentVars } from '@services/graphql/api'; import { sendComment } from '@services/graphql/comments'; +import { SendCommentInput } from '@ts/types/graphql/mutations'; import useIsMounted from '@utils/hooks/use-is-mounted'; import Script from 'next/script'; import { FC, HTMLAttributes, ReactNode, useRef, useState } from 'react'; @@ -130,7 +130,7 @@ const PageLayout: FC = ({ if (!id) throw new Error('Page id missing. Cannot save comment.'); const { comment: commentBody, email, name, parentId, website } = data; - const commentData: SendCommentVars = { + const commentData: SendCommentInput = { author: name, authorEmail: email, authorUrl: website || '', -- cgit v1.2.3