Skip to content

Conversation

@KipzonderKop101
Copy link
Contributor

  • I have read the Contribution guide
  • This PR references an issue (except for typos, broken links, or other minor problems)

Description(required)

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:

const getUserQuery = query(async (id: string) => {
  // ... Fetches the user from the server.
}, "user");

function UserProfile() {
  const user = createAsync(() => getUserQuery());

This causes a TypeScript error and fails at runtime.

I updated the example to pass an argument to getUserQuery().

Thanks for considering!

Related issues & labels

Suggested label: documentation

…tion

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.
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Jan 2, 2026

Deploy Preview for solid-docs failed. Why did it fail? →

Name Link
🔨 Latest commit d78aac0
🔍 Latest deploy log https://app.netlify.com/projects/solid-docs/deploys/6957fa32954fbc00084799b8

A earlier mistake was made, as I updated only one of the two examples. Updated second example too.
@amirhhashemi
Copy link
Collaborator

Thank you for letting us know about this and for taking the time to fix it. I don't quite like this approach for a couple of reasons:

  1. I don't like using arbitrary values like "user-123"
  2. I think the console.logs and the comments that go with them aren’t needed.

However, I will fix it myself shortly. I think I need to rewrite the examples completely so that they do not require parameters.

@KipzonderKop101
Copy link
Contributor Author

Of course, whatever fits best! Thanks for taking the time to review and fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants