From 556317ae4d3167a974dea21a6e3625c2e94dab45 Mon Sep 17 00:00:00 2001
From: KipZonderKop101 <80620930+KipzonderKop101@users.noreply.github.com>
Date: Fri, 2 Jan 2026 14:02:43 +0100
Subject: [PATCH 1/2] docs: fix createAsync example to pass required argument
to query function
Fixes the createAsync example in the documentation to properly demonstrate passing arguments to a query function.
The current example defines getUserQuery with a required id parameter, but never passes this argument when calling the function. This causes a TypeScript error and fails at runtime.
---
src/routes/solid-router/reference/data-apis/create-async.mdx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/routes/solid-router/reference/data-apis/create-async.mdx b/src/routes/solid-router/reference/data-apis/create-async.mdx
index bfbdac549..2da27dc36 100644
--- a/src/routes/solid-router/reference/data-apis/create-async.mdx
+++ b/src/routes/solid-router/reference/data-apis/create-async.mdx
@@ -123,11 +123,14 @@ import { Suspense, ErrorBoundary, For } from "solid-js";
import { createAsync, query } from "@solidjs/router";
const getUserQuery = query(async (id: string) => {
+ // You can use the parameters here
+ console.log(id);
+
// ... Fetches the user from the server.
}, "user");
function UserProfile() {
- const user = createAsync(() => getUserQuery());
+ const user = createAsync(() => getUserQuery("user-123"));
return (
{user()?.name}
; }