Skip to content

Commit

Permalink
docs(relay): return Observable<any> because of graphql vs relay-runti…
Browse files Browse the repository at this point in the history
…me types dissagreement [skip ci]

#316 (comment)
  • Loading branch information
enisdenjo committed Feb 22, 2022
1 parent 485d46a commit 96058eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>, please see: https://github.com/enisdenjo/graphql-ws/issues/316#issuecomment-1047605774
function fetchOrSubscribe(operation: RequestParameters, variables: Variables): Observable<any> {
return Observable.create((sink) => {
if (!operation.text) {
return sink.error(new Error('Operation text cannot be empty'));
Expand Down

0 comments on commit 96058eb

Please sign in to comment.