diff options
Diffstat (limited to 'src/services/graphql/contact.ts')
| -rw-r--r-- | src/services/graphql/contact.ts | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/services/graphql/contact.ts b/src/services/graphql/contact.ts deleted file mode 100644 index 3098374..0000000 --- a/src/services/graphql/contact.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { SendMailInput } from '../../types'; -import { fetchAPI } from './api'; -import { sendMailMutation } from './contact.mutation'; - -export type SentEmail = { - clientMutationId: string; - message: string; - origin: string; - replyTo: string; - sent: boolean; -}; - -/** - * Send an email using GraphQL API. - * - * @param {SendMailInput} data - The mail data. - * @returns {Promise<SentEmail>} The mutation response. - */ -export const sendMail = async (data: SendMailInput): Promise<SentEmail> => { - const response = await fetchAPI<SentEmail, typeof sendMailMutation>({ - query: sendMailMutation, - variables: { ...data }, - }); - - return response.sendEmail; -}; |
