Skip to content

Commit 86bdb4c

Browse files
committed
docs
1 parent 96aaa7f commit 86bdb4c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,15 @@ The generated client is headless - you need to provide your own fetcher. Here ar
8585

8686
### Type-Safe Error Handling
8787

88-
The generated client includes discriminated union types for handling both success and error responses:
88+
The generated client supports two response modes:
8989

9090
```typescript
91-
// With withResponse: true, get full response details
91+
// Default: Direct data return (simpler, but no error details)
92+
const user = await api.get("/users/{id}", {
93+
path: { id: "123" }
94+
}); // user is directly typed as User object
95+
96+
// WithResponse: Full response details (for error handling)
9297
const result = await api.get("/users/{id}", {
9398
path: { id: "123" },
9499
withResponse: true

0 commit comments

Comments
 (0)