Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.

Commit 3e7e032

Browse files
committed
fix: our fake iterator for subscribe to match expectations
1 parent 35efb4c commit 3e7e032

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/pubsub/subscribe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const concat =
3232
const createHandler = (topicDefinitions: SubscriptionDefinition[]) => {
3333
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3434
// eslint-disable-next-line require-yield
35-
const handler: any = function *() {
35+
const handler: any = async function *() {
3636
throw new Error('Subscription handler should not have been called')
3737
}
3838
handler.topicDefinitions = topicDefinitions

lib/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
/* eslint-disable @typescript-eslint/ban-types */
23
import { ConnectionInitMessage, PingMessage, PongMessage } from 'graphql-ws'
34
import { DataMapper } from '@aws/dynamodb-data-mapper'
@@ -72,7 +73,7 @@ export type SubscriptionDefinition = {
7273
export type SubscribeHandler = (...args: any[]) => SubscribePsuedoIterable
7374

7475
export type SubscribePsuedoIterable = {
75-
(...args: SubscribeArgs): Generator<never, never, unknown>
76+
(...args: SubscribeArgs): AsyncGenerator<never, never, unknown>
7677
topicDefinitions: SubscriptionDefinition[]
7778
onSubscribe?: (...args: SubscribeArgs) => void | Promise<void>
7879
onComplete?: (...args: SubscribeArgs) => void | Promise<void>

0 commit comments

Comments
 (0)