Skip to content
v2.1.0

Capturing traffic

Operations appearing in Traffic as the page makes them, then opening one to see its Request, Response, Headers and Timing. Narrated, with sound. The dark and light versions follow the site's theme.

Open DevTools on any page and choose the Wireglass tab, then Traffic. It lists the page’s GraphQL HTTP operations as they finish:

  • POST and GET requests, batched requests (one row per operation, marked batch i/n), and persisted queries (persisted:<hash>).
  • Each row shows its type, name, endpoint, status and duration.

A request whose document doesn’t parse still shows, marked unparsed. Requests made before DevTools was opened are included. The list head shows how many operations are listed, out of how many captured, and how many are still pending.

DevTools reports a request only once it has finished, so Wireglass also watches the page: a GraphQL request shows up as soon as the page sends it, at the bottom of the list, with a spinner and a clock that keeps counting. Its status says what it is doing:

  • Pending: waiting for the server.
  • Receiving: the response has started and is still arriving. A stream (an event stream or a multipart response) stays here until the server ends it.
  • Failed or Cancelled: what the page saw, until DevTools reports it with the reason.

When DevTools reports the request, its row takes the pending one’s place, and stays selected if you had selected it.

Traffic with a finished Viewer query and three pending requests. The selected SalesReport has waited 3 seconds; its detail shows the query and its variables.Traffic with a finished Viewer query and three pending requests. The selected SalesReport has waited 3 seconds; its detail shows the query and its variables.
Three requests in flight. The selected one shows what was sent while it waits.

Select a pending request to see its Request (query and variables) and Headers (only the ones the page set itself, until it finishes). Open in client works already. The filter’s words and type apply to pending requests; filters that need a response, such as Errors only or slow:>1s, leave them out.

Some requests can’t show as pending, only once they finish:

  • on a page that was open before Wireglass was installed or updated (reload it);
  • requests whose body isn’t plain text: file uploads (FormData), streams, or a Request object carrying its own body;
  • a request the page sends right after a reload, before the panel reconnects to it; it shows as pending if it’s still running once the panel has.

Nothing is reported while the Wireglass panel is closed, and a request a mock rule answers never shows as pending.

One row, however narrow the panel:

  • Clear (the trash icon) empties the list.
  • The filter box, then All / HTTP / WebSocket with the number of operations of each kind. In a narrow panel WebSocket shortens to WS.
  • List and Timeline switch between this list and a timeline of swim lanes.
  • ⋯ holds the rest: the operation type, Errors only, Preserve log, Include secrets and Export HAR. See Filter, search, copy and export.

Icon buttons say what they do as soon as you point at them.

Drag the edge of the Name, Status, Time or Size header to resize that column; double-click it to go back to the default width. Endpoint takes the space left. The widths are remembered. In a narrow pane the table shrinks to fit instead of scrolling sideways.

Select a row for Request (the query and its variables), Response, Headers (the request headers, then the response headers) and Timing. A failed request names its status above the response and says what it usually means; GraphQL errors are listed one by one (Errors). Request also lists anything the operation uses that the schema deprecates (Deprecated fields). In Request and Headers, drag the handle between the two parts to give one more room; double-click it to reset. The sizes are remembered. The pane opens on Response; pick another section in Settings → Traffic → Operation detail opens on.

Its bar is one row: the sections, Open in client, then ⋯ (Copy as cURL, Copy as fetch and Mock this response) and the buttons that maximise or close the pane.

Queries, variables and JSON responses are highlighted code with fold arrows on every block. The bar above each one has Expand all, Collapse all and Copy, which copies the full text even when folded. Responses use the response viewer.

Operations the page runs over graphql-transport-ws (the graphql-ws library) or legacy subscriptions-transport-ws appear in the same list, tagged WS. The All / HTTP / WebSocket switch shows one kind at a time.

Each operation is one row with its state (live, done, stopped, error or closed) and the number of results. Live operations stay at the top of the list while they run; turn off Settings → Traffic → Show live WebSocket operations at the top to keep them in time order with the rest. Its detail pane has Request, Messages (every message; pick one to see its payload), Connection (URL, protocol, the connection_init payload and any close code) and Timing.

A small script in each page wraps WebSocket to see the frames. Nothing is sent anywhere but this extension’s own panel, and only while the panel is open for that tab. Until then the page keeps the last 500 messages (plus a few connection starts) so subscriptions started before you opened DevTools still show their query. That includes sockets the page opens while it loads, so after a reload each row still shows its endpoint.

The list keeps the newest 1,000 operations and clears on navigation: a page load, or an in-app route change to a different path. A change of only the query string or hash keeps it. Turn on Preserve log in the toolbar’s ⋯ menu to keep everything across navigations. The setting is remembered; the captured traffic is not. It lives in memory only.

Open in client opens the operation in a client tab with the endpoint, query, variables and the app’s headers (such as authorization and x-*), but never cookies or browser headers. If the client’s current tab is new and untouched, the operation fills it instead of opening another. It sends nothing: press Run when ready. Persisted-only rows can’t be opened, because the page never sent their query text.

JSON bodies (including variables or extensions sent as a JSON string), GET requests (including double-encoded parameters), application/graphql bodies, multipart uploads, and Relay-style doc_id / documentId requests (listed as persisted rows). application/x-www-form-urlencoded bodies aren’t captured yet.