From a7c1d78e93490b1dab5332b05f2b5d0a43c75fc1 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Sep 2026 16:41:34 +0000 Subject: [PATCH 1/2] docs(plugin-axios,plugin-fetch): document the unwrap() method Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_012DSVW79h2FdFDkoWWr6PwN --- snippets/how-to/calling-operations.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/snippets/how-to/calling-operations.md b/snippets/how-to/calling-operations.md index d5b62178..91f115c9 100644 --- a/snippets/how-to/calling-operations.md +++ b/snippets/how-to/calling-operations.md @@ -91,6 +91,21 @@ if (result.status === 200) { Reading the `error` body and handling failures is covered in [error handling](/plugins/plugin-fetch/guide/error-handling). +## Unwrap the success body + +Every call's promise also carries an `unwrap()` method, the way Redux Toolkit's `unwrap()` works +on a dispatched thunk. It resolves to the bare success body, or rejects with `error` for a call +made with `throwOnError: false`: + +```typescript +import { getPetById } from './gen/clients/getPetById' + +const pet = await getPetById({ path: { petId: 1 } }).unwrap() +// ^ the parsed pet, not the full RequestResult +``` + +Awaiting the call directly still resolves to the full result, so existing code keeps working. + ## Set the content type When an operation accepts or returns more than one media type, set `contentType` on the call. A From 775442e7f8c1e683073c068c2d4e0b9cb17bf839 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Sep 2026 16:52:06 +0000 Subject: [PATCH 2/2] docs(plugin-axios,plugin-fetch): drop the Redux Toolkit reference Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_012DSVW79h2FdFDkoWWr6PwN --- snippets/how-to/calling-operations.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/snippets/how-to/calling-operations.md b/snippets/how-to/calling-operations.md index 91f115c9..529bcdaa 100644 --- a/snippets/how-to/calling-operations.md +++ b/snippets/how-to/calling-operations.md @@ -93,9 +93,8 @@ Reading the `error` body and handling failures is covered in ## Unwrap the success body -Every call's promise also carries an `unwrap()` method, the way Redux Toolkit's `unwrap()` works -on a dispatched thunk. It resolves to the bare success body, or rejects with `error` for a call -made with `throwOnError: false`: +Every call's promise also carries an `unwrap()` method. It resolves to the bare success body, or +rejects with `error` for a call made with `throwOnError: false`: ```typescript import { getPetById } from './gen/clients/getPetById'