How to log requests made by Apollo Client? (with BatchHttpLink)

Hey folks,
I’m looking for a way to log all requests with responses made by Apollo Client.

Using example link from docs doesn’t work for me, because it logs operations, not requests. That would be ok, but when using BatchHttpLink, Apollo logs every batched operation separately.

Wrapping fetch link this works with requests, but it doesn’t let me access responses, so I don’t have insights about requests timings.

  const httpLink = new BatchHttpLink({
    uri: API_URL,
    fetch: (input, init) => {
      if (debug) {
        const body = init?.body && JSON.parse(init.body.toString());
        const operations = body.map((ops: any) => ops.operationName);

        console.log({
          startTime: new Date(),
          url: input,
          method: init?.method,
          operations,
        });
      }

      return fetch(input, init);
    },
  });