Repository navigation
docs(client, openapi): fix the origin callback arguments in link examples - #2538
Conversation
…ples The origin examples read path from the first argument, but it is the second.
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/effect
@orpc/evlog
@orpc/hibernation
@orpc/json-schema
@orpc/experimental-lock
@orpc/mcp
@orpc/msw
@orpc/nest
@orpc/next
@orpc/node
@orpc/openapi
@orpc/experimental-openapi-inference
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/swr
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
orpc | 6b241e5 | Commit Preview URL Branch Preview URL |
Nov 23 2026, 07:48 AM |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound — this corrects the examples to the transport's actual positional callback signature instead of reshaping the public option API, which keeps the docs aligned with shipped types.
Reviewed changes
- RPC link example —
originnow declared as(options, path), matchingValue<..., [options: ClientOptions<T>, path: string[]]>inpackages/client/src/adapters/fetch/transport.ts, where it is resolved viavalue(this.origin, options, path). - OpenAPI link example — same fix;
OpenAPILinkOptionsextendsFetchLinkTransportOptions<T>, so the signature is identical there. - Neighbouring examples — verified the
headerscallback in the same snippets is still correct: headers is invoked with positional(options, path, input), so destructuring{ context }from the first argument works. No({ path, context })occurrences remain anywhere in the repo.
The snippets are plain ts fences rather than twoslash, so they are not typechecked at docs build time, which is why the mismatch went unnoticed. That is a pre-existing gap rather than something this PR introduces.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing Footnotes
|

What changed
The
originexample in the RPC Link and OpenAPI Link docs now usesorigin: (options, path) => ....Why
The examples destructured
pathfrom the first argument (({ path, context }) => ...), butoriginreceives(options, path). Copied as-is, the example is a type error in TypeScript, and in JavaScriptpathisundefined.Notes for review
apps/content/docs/rpc/link.mdxandapps/content/docs/openapi/link.mdx.