# contentful-resolve-response

> [![npm](https://img.shields.io/npm/v/contentful-resolve-response.svg)](https://www.npmjs.com/package/contentful-resolve-response) [![CI](https://github.com/contentful/contentful-resolve-response/actions/workflows/main.yaml/badge.svg)](https://github.com/c

Latest version **2.0.1** (published 2026-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install contentful-resolve-response
pnpm add contentful-resolve-response
yarn add contentful-resolve-response
bun add contentful-resolve-response
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-07-07 |
| First published | 2014-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/contentful-resolve-response) |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 1 |
| Unpacked size | 20 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 57 |
| Author | Contentful GmbH |
| Maintainers | whydah-gally, contentful-ecosystem |

## Links

- npm: https://www.npmjs.com/package/contentful-resolve-response
- Repository: https://github.com/contentful/contentful-resolve-response
- Issues: https://github.com/contentful/contentful-resolve-response/issues
- npm.io page: https://npm.io/package/contentful-resolve-response

## Dependencies (1)

- [fast-copy](https://npm.io/package/fast-copy.md) ^3.0.2

## Recent versions

- 2.0.1 (latest) — 2026-07-07
- 1.9.5-update-pipeline.1 (dev) — 2025-12-02
- 2.0.0 — 2026-06-05
- 1.9.9 — 2026-06-04
- 1.9.8 — 2026-03-18
- 1.9.7 — 2026-03-17
- 1.9.6 — 2026-02-23
- 1.9.5 — 2026-01-09
- 1.9.4 — 2025-10-02
- 1.9.3 — 2025-05-09
- 1.9.2 — 2024-12-09
- 1.9.1 — 2024-12-06
- 1.9.0 — 2024-07-31
- 1.8.2 — 2024-06-18
- 1.8.1 — 2023-08-18
- … 33 more at https://npm.io/package/contentful-resolve-response/versions

## README

# contentful-resolve-response

[![npm](https://img.shields.io/npm/v/contentful-resolve-response.svg)](https://www.npmjs.com/package/contentful-resolve-response)
[![CI](https://github.com/contentful/contentful-resolve-response/actions/workflows/main.yaml/badge.svg)](https://github.com/contentful/contentful-resolve-response/actions/workflows/main.yaml)

Suppose you have a Contentful query's response JSON. The links are
nice, but what we really usually need is the response with a resolved
object graph.

`contentful-resolve-response` does just that:

```js
var resolveResponse = require('contentful-resolve-response');

var response = {
  items: [
    {
      someValue: 'wow',
      someLink: { sys: { type: 'Link', linkType: 'Entry', id: 'suchId' } }
    }
  ],
  includes: {
    Entry: [
      { sys: { type: 'Entry', id: 'suchId' }, very: 'doge' }
    ]
  }
};

var items = resolveResponse(response)
// Responds with the resolved array of items.

console.log(items);

// produces:
// re`solved` object [Array] of items.
  [
    {
      // Value stays the same
      someValue: 'wow',

      // Link gets replaced by the actual object from `includes.Entry`
      someLink: {sys: {type: 'Entry', id: 'suchId'}, very: 'doge'}
    }
  ]
```

Note that:

- Multiple links to the same resource will point to the same object
- Circular references are possible, still!!

## For AI Agents

<!-- Generated by seed-golden-context | Last updated: 2026-05-07 -->
If you are an AI coding agent working in this repository, read [AGENTS.md](./AGENTS.md) first. It tells you where to find architectural context, development setup, decision records, and repo-specific rules.

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