aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/templates/page/page-layout.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-08-20 21:39:51 +0200
committerArmand Philippot <git@armandphilippot.com>2022-08-20 21:39:51 +0200
commita0d00743cbbdb77b27c1a3d5711407ffed5befac (patch)
treef4caab160daf6b93c74d60ab93edd265c8edb158 /src/components/templates/page/page-layout.tsx
parent46b158bf9d2f7fa9cc253915151e0b53c052a444 (diff)
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.
Diffstat (limited to 'src/components/templates/page/page-layout.tsx')
-rw-r--r--src/components/templates/page/page-layout.tsx4
1 files changed, 2 insertions, 2 deletions
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<PageLayoutProps> = ({
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 || '',