From fcabd93cff86c4f4296e7b1a4f8b7dddfc95e836 Mon Sep 17 00:00:00 2001 From: Kristaps Fabians Geikins Date: Mon, 29 Jul 2024 11:38:08 +0300 Subject: [PATCH] fix(server): ability to reset mock store --- packages/server/modules/mocks.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/server/modules/mocks.ts b/packages/server/modules/mocks.ts index b2c5a81638..8c4181304d 100644 --- a/packages/server/modules/mocks.ts +++ b/packages/server/modules/mocks.ts @@ -24,7 +24,13 @@ const buildBaseConfig = async (): Promise => { const faker = (await import('@faker-js/faker')).faker return { - resolvers: ({ helpers: { getFieldValue } }) => ({ + resolvers: ({ helpers: { getFieldValue }, store }) => ({ + Query: { + _: () => { + store.reset() + return 'Mock Store reset!' + } + }, LimitedUser: { role: (parent) => getFieldValue(