From 96058eb08f9c98ea4102f0aa90cc25f7be12f955 Mon Sep 17 00:00:00 2001 From: Denis Badurina Date: Tue, 22 Feb 2022 10:44:34 +0100 Subject: [PATCH] docs(relay): return Observable because of graphql vs relay-runtime types dissagreement [skip ci] https://github.com/enisdenjo/graphql-ws/issues/316#issuecomment-1047605774 --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bd400a50..2acb25ad 100644 --- a/README.md +++ b/README.md @@ -353,8 +353,9 @@ const subscriptionsClient = createClient({ }, }); -// yes, both fetch AND subscribe handled in one implementation -function fetchOrSubscribe(operation: RequestParameters, variables: Variables) { +// both fetch and subscribe can be handled through one implementation +// to understand why we return Observable, please see: https://github.com/enisdenjo/graphql-ws/issues/316#issuecomment-1047605774 +function fetchOrSubscribe(operation: RequestParameters, variables: Variables): Observable { return Observable.create((sink) => { if (!operation.text) { return sink.error(new Error('Operation text cannot be empty'));