Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature: Make context available in server function validators#3648

dxptqhtlutehvlyxcmtg started this conversation inIdeas
Discussion options

It'd be great if server function validators could receive the current request context. Currently, it seems impossible to have "runtime" schemas that depend on the current user's information, say currency type or time zone.

Unlike handlers, which can read the session supplied by middleware via the context, I don't see a way for validators to access that context.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

can't you read the context via getWebRequest()?

You must be logged in to vote
1 reply
@thefrana
Comment options

In newer versions of TanStack Start,getWebRequest no longer exists—onlygetRequest, which does not include a context. Is there a way to access the request context without having to pass it from server functions through every subsequent function call? Dependency injection is the obvious solution, but we could also use the request context itself as a simpler alternative. Thanks!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
3 participants
@dxptqhtlutehvlyxcmtg@schiller-manuel@thefrana

[8]ページ先頭

©2009-2025 Movatter.jp