Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions documentation/docs/20-core-concepts/60-remote-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ export const getPost = query(v.string(), async (slug) => {
Both the argument and the return value are serialized with [devalue](https://github.com/sveltejs/devalue), which handles types like `Date` and `Map` (and custom types defined in your [transport hook](hooks#Universal-hooks-transport)) in addition to JSON.

> [!NOTE] For `query` and `prerender` arguments (but not return values), objects, maps, and sets are sorted so that instances with the same members result in the same cache key. For example, `getPosts({ limit: 10, offset: 10 })` and `getPosts({ offset: 10, limit: 10 })` will result in the same cache key. If order is important to you, you'll have to use an array.
>
> If a query has a schema, the cache key is still based on the argument you pass to the query function before validation. Extra object properties therefore create a different cache key, even if the schema ignores them on the server. Make sure calls that refer to the same query instance use the same argument shape, including calls to `.set(...)` and `.refresh()`. For example, destructure route params before passing them to a query instead of passing `params` directly if it contains unrelated keys.

### Deduplication

Expand Down