INNER CODE UNIT · TypeScript

getResults

enisdenjo/graphql-sse · src/client.ts:551

            for await (const result of getResults()) {
              // only after receiving results are future connects not considered retries.
              // this is because a client might successfully connect, but the server
              // ends up terminating the connection afterwards before streaming anything.
              // of course, if the client completes the subscription, this loop will
              // break and therefore stop the stream (it wont reconnect)
              retryingErr = null;
              retries = 0;

              // eslint-disable-next-line @typescript-eslint/no-explicit-any
              sink.next(result as any);
            }

            return control.abort();
          } catch (err) {
            if (control.signal.aborted) return;

            // all non-network errors are worth reporting immediately

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…