# @whook/graphiql

> A wrapper for the Whook HTTP Router to provide GraphIQL for local dev

Latest version **27.0.3** (published 2026-11-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @whook/graphiql
pnpm add @whook/graphiql
yarn add @whook/graphiql
bun add @whook/graphiql
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 27.0.3 |
| Published | 2026-11-13 |
| First published | 2020-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=24.14.0 |
| Dependencies | 4 |
| Unpacked size | 73.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Nicolas Froidure |
| Maintainers | nfroidure |
| Keywords | whook, knifecycle, REST, HTTP, OpenAPI, web, wrapper, swagger |

## Links

- npm: https://www.npmjs.com/package/@whook/graphiql
- Repository: https://github.com/nfroidure/whook
- Issues: https://github.com/nfroidure/whook/issues
- Funding: https://github.com/sponsors/nfroidure
- npm.io page: https://npm.io/package/@whook/graphiql

## Dependencies (4)

- [yerror](https://npm.io/package/yerror.md) ^11.0.0
- [knifecycle](https://npm.io/package/knifecycle.md) ^21.4.0
- [@whook/whook](https://npm.io/package/@whook/whook.md) ^27.0.3
- [ya-open-api-types](https://npm.io/package/ya-open-api-types.md) ^2.2.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 27.0.3 (latest) — 2026-11-13
- 27.0.2 — 2026-11-02
- 27.0.1 — 2026-10-29
- 27.0.0 — 2026-10-27
- 26.3.0 — 2026-09-14
- 26.2.0 — 2026-09-07
- 26.1.0 — 2026-08-26
- 26.0.5 — 2026-08-20
- 26.0.2 — 2026-08-11
- 26.0.0 — 2026-08-07
- 25.2.0 — 2026-07-19
- 25.1.0 — 2026-06-08
- 25.0.0 — 2026-05-18
- 24.1.1 — 2026-05-15
- 24.1.0 — 2026-05-13
- … 94 more at https://npm.io/package/@whook/graphiql/versions

## README

[//]: # ( )
[//]: # (This file is automatically generated by a `metapak`)
[//]: # (module. Do not change it  except between the)
[//]: # (`content:start/end` flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
# @whook/graphiql
> A wrapper for the Whook HTTP Router to provide GraphIQL for local dev

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/whook/blob/main/packages/whook-graphiql/LICENSE)


[//]: # (::contents:start)

This module provides the GraphIQL UI to your local
[Whook](https://github.com/nfroidure/whook) server !

## Usage

The `DEV_MODE=1` environment variable must be used when starting your server
(the `npm run dev` script of default Whook projects does it by default).

## Setup

Install the module:

```sh
npm i @whook/graphiql
```

Update the types (usually in `src/whook.d.ts`):

```diff
+import {
+   type WhookGraphIQLEnv,
+   type WhookGraphIQLConfig,
+} from '@whook/graphiql';

// ...

declare module 'application-services' {

  export interface AppEnvVars
    extends BaseAppEnvVars,
      WhookBaseEnv,
      // (...)
+      WhookGraphIQLEnv,
      WhookSwaggerUIEnv {}

  // (...)

  export interface AppConfig
    extends WhookBaseConfigs,
      // (...)
+      WhookGraphIQLConfig,
      JWTServiceConfig {}

  // ...

}
```

Then, just wrap the HTTP router with this module and register it again with the
`Knifecycle` instance inside the `runProcess` function (usually in
`src/index.ts`):

```diff
+ import { initHTTPRouter } from '@whook/whook';
+ import wrapHTTPRouterWithGraphIQL from '@whook/graphiql';

// (...)

// It is important to do this in the runProcess function since it really
//  make sense only when actually running the server
export async function runProcess(injectedNames = [], $ = new Knifecycle()) {

  // (...)

+  // Add support for GraphIQL UI by wrapping and
+  //  overriding the original HTTP Router
+  $.register(
+    wrapHTTPRouterWithGraphIQL(initHTTPRouter),
+  );

  return await runBaseProcess(injectedNames, $);
}
```

[//]: # (::contents:end)

# API

# Authors
- [Nicolas Froidure](http://insertafter.com/en/index.html)

# License
[MIT](https://github.com/nfroidure/whook/blob/main/packages/whook-graphiql/LICENSE)

---
_Source: https://npm.io/package/@whook/graphiql · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
