# @apollo-link-debug/handle-request

> Debugs the operation name and variables used for a GraphQL request via apollo.

Latest version **1.0.1** (published 2026-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @apollo-link-debug/handle-request
pnpm add @apollo-link-debug/handle-request
yarn add @apollo-link-debug/handle-request
bun add @apollo-link-debug/handle-request
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2026-08-16 |
| First published | 2023-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Maintainers | bashaus |

## Links

- npm: https://www.npmjs.com/package/@apollo-link-debug/handle-request
- Repository: https://github.com/bashaus/apollo-link-debug
- Homepage: https://github.com/bashaus/apollo-link-debug/tree/main/packages/handle-request
- Issues: https://github.com/bashaus/apollo-link-debug/issues
- npm.io page: https://npm.io/package/@apollo-link-debug/handle-request

## Recent versions

- 1.0.1 (latest) — 2026-08-16
- 1.0.0 — 2026-08-16
- 0.1.0 — 2025-07-06
- 0.0.5 — 2023-06-14
- 0.0.4 — 2023-06-05
- 0.0.3 — 2023-04-02
- 0.0.2 — 2023-04-01
- 0.0.1 — 2023-04-01

## README

# @apollo-link-debug/handle-request

Debugs the operation name and variables used for a GraphQL request via apollo.

## Installation

Requires **@apollo/client v4**.

```bash
npm i @apollo/client @apollo-link-debug/handle-request
# - or -
yarn add @apollo/client @apollo-link-debug/handle-request
```

## Usage

```typescript
import { ApolloClient, ApolloLink, InMemoryCache } from "@apollo/client";
import { RequestLink } from "@apollo-link-debug/handle-request";

const client = new ApolloClient({
  uri: "https://localhost:3000/",
  cache: new InMemoryCache(),
  link: ApolloLink.from([new RequestLink()]),
});

const query = client.query({
  query: gql`query MyOperationName { ... }`,
  variables: {
    variableName: "variableValue",
  },
});
```

Example output:

```text
MyOperationName {
  "variableName": "variableValue"
}
```

## Options

### `onRequest: ({ operation }) => void`

A callback which occurs on every GraphQL request as the request is made. The
default is to log the operation name and the variables (as JSON) used for
the query.

---
_Source: https://npm.io/package/@apollo-link-debug/handle-request · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
