From 2faf2e34331703b3bdea3eb487cb8799c8d65377 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 19 Sep 2023 18:13:57 +0200 Subject: refactor(build): replace paths aliases with relative paths Using paths aliases starting with "@" can be confusing and can lead to conflict with existings modules. I prefer to use relative paths to avoid extra configuration in tools because of these aliases. --- src/types/graphql/mutations.ts | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/types/graphql/mutations.ts (limited to 'src/types/graphql/mutations.ts') diff --git a/src/types/graphql/mutations.ts b/src/types/graphql/mutations.ts new file mode 100644 index 0000000..581a46e --- /dev/null +++ b/src/types/graphql/mutations.ts @@ -0,0 +1,61 @@ +import { sendCommentMutation } from '../../services/graphql/comments.mutation'; +import { sendMailMutation } from '../../services/graphql/contact.mutation'; + +//=========================================================================== +// Existing mutations list +//=========================================================================== + +export type Mutations = typeof sendMailMutation | typeof sendCommentMutation; + +//=========================================================================== +// Mutations response types +//=========================================================================== + +export type SendCommentResponse = { + createComment: T; +}; + +export type SendMailResponse = { + sendEmail: T; +}; + +export type MutationsResponseMap = { + [sendCommentMutation]: SendCommentResponse; + [sendMailMutation]: SendMailResponse; +}; + +export type Approved = { + approved: boolean; +}; + +export type SentComment = { + clientMutationId: string; + success: boolean; + comment: Approved | null; +}; + +//=========================================================================== +// Mutations input types +//=========================================================================== + +export type SendCommentInput = { + author: string; + authorEmail: string; + authorUrl: string; + clientMutationId: string; + commentOn: number; + content: string; + parent?: number; +}; + +export type SendMailInput = { + body: string; + clientMutationId: string; + replyTo: string; + subject: string; +}; + +export type MutationsInputMap = { + [sendCommentMutation]: SendCommentInput; + [sendMailMutation]: SendMailInput; +}; -- cgit v1.2.3