aboutsummaryrefslogtreecommitdiffstats
path: root/tests/msw/schema/types
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-12-11 17:52:38 +0100
committerArmand Philippot <git@armandphilippot.com>2023-12-11 17:52:38 +0100
commit93db24b7f7650abac1bb7095026e3a1f367b0c0a (patch)
treec6efd8669d333941494e573d2468a4fb6603b134 /tests/msw/schema/types
parentcd2cb5748be9e9c479d9802dd3897de1cd1cbd9f (diff)
refactor(pages): refine Contact page
* remove next/router dependency * remove pageTitle since it is defined in MDX * reduce statements by grouping messages * mock response with MSW and add test for sendEmail
Diffstat (limited to 'tests/msw/schema/types')
-rw-r--r--tests/msw/schema/types/index.ts7
-rw-r--r--tests/msw/schema/types/send-email.types.ts17
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/msw/schema/types/index.ts b/tests/msw/schema/types/index.ts
index ada7f2c..1063772 100644
--- a/tests/msw/schema/types/index.ts
+++ b/tests/msw/schema/types/index.ts
@@ -3,6 +3,7 @@ import { commentTypes } from './comment.types';
import { commonTypes } from './common.types';
import { featuredImageTypes } from './featured-image.types';
import { postTypes } from './post.types';
+import { sendEmailTypes } from './send-email.types';
import { thematicTypes } from './thematic.types';
import { topicTypes } from './topic.types';
@@ -52,13 +53,19 @@ const rootQueryType = `type Query {
): RootQueryToTopicConnection
}`;
+const rootMutationType = `type Mutation {
+ sendEmail(input: SendEmailInput!): SendEmailPayload
+}`;
+
export const types = [
authorTypes,
commentTypes,
commonTypes,
featuredImageTypes,
postTypes,
+ sendEmailTypes,
thematicTypes,
topicTypes,
rootQueryType,
+ rootMutationType,
];
diff --git a/tests/msw/schema/types/send-email.types.ts b/tests/msw/schema/types/send-email.types.ts
new file mode 100644
index 0000000..5889572
--- /dev/null
+++ b/tests/msw/schema/types/send-email.types.ts
@@ -0,0 +1,17 @@
+export const sendEmailTypes = `input SendEmailInput {
+ body: String
+ clientMutationId: String
+ from: String
+ replyTo: String
+ subject: String
+ to: String
+}
+
+type SendEmailPayload {
+ clientMutationId: String
+ message: String
+ origin: String
+ replyTo: String
+ sent: Boolean
+ to: String
+}`;