Skip to content

Commit b155177

Browse files
committed
refactor: consolidate onQuery and onMutation event factories into a single onGraphqlEventFactory
1 parent 9e3a12e commit b155177

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

packages/event-handler/tests/helpers/factories.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,14 @@ const createEventFactory = (
9898
stash: {},
9999
});
100100

101-
const onQueryEventFactory = (
102-
fieldName = 'getPost',
103-
args = {},
104-
typeName = 'Query'
105-
) => createEventFactory(fieldName, args, typeName);
106-
107-
const onMutationEventFactory = (
108-
fieldName = 'addPost',
109-
args = {},
110-
typeName = 'Mutation'
101+
const onGraphqlEventFactory = (
102+
fieldName: string,
103+
typeName: 'Query' | 'Mutation',
104+
args: Record<string, unknown> = {}
111105
) => createEventFactory(fieldName, args, typeName);
112106

113107
export {
114108
onPublishEventFactory,
115109
onSubscribeEventFactory,
116-
onQueryEventFactory,
117-
onMutationEventFactory,
110+
onGraphqlEventFactory,
118111
};

0 commit comments

Comments
 (0)