fix: multiple requests appearing on teams (#2455)

Co-authored-by: Nivedin <53208152+nivedin@users.noreply.github.com>
This commit is contained in:
Andrew Bastin
2022-06-30 18:33:42 +05:30
parent c34185dc4b
commit cac3abd2ab
3 changed files with 74 additions and 18 deletions

View File

@@ -221,7 +221,7 @@ export const runGQLSubscription = <
createRequest(args.query, args.variables)
)
wonkaPipe(
const sub = wonkaPipe(
source,
subscribe((res) => {
result$.next(
@@ -256,7 +256,8 @@ export const runGQLSubscription = <
})
)
return result$
// Returns the stream and a subscription handle to unsub
return [result$, sub] as const
}
export const useGQLQuery = <DocType, DocVarType, DocErrorType extends string>(