Solid Query docs: Code examples with `useSuspenseQuery` that don't exist #9654
Send to my agentDescribe the bug#
On some pages such as https://tanstack.com/query/latest/docs/framework/solid/guides/request-waterfalls, there are code examples showing useSuspenseQuery which does not appear to be a function exposed by the Solid Query library.
I also am not sure about the technical accuracy of some claims:
Another example of serial queries is when you use Solid Query with Suspense:
function App () { // The following queries will execute in serial, causing separate roundtrips to the server: const usersQuery = useSuspenseQuery({ queryKey: ['users'], queryFn: fetchUsers }) const teamsQuery = useSuspenseQuery({ queryKey: ['teams'], queryFn: fetchTeams }) const projectsQuery = useSuspenseQuery({ queryKey: ['projects'], queryFn: fetchProjects }) // Note that since the queries above suspend rendering, no data // gets rendered until all of the queries finished ... }
This appears to be a React-specific consideration; on the other hand I'm not sure that this would perform serial execution in Solid (but I am a newbie and I am not sure, this is just from what I have gleamed)
Your minimal, reproducible example#
https://tanstack.com/query/latest/docs/framework/solid/guides/request-waterfalls
Steps to reproduce#
Visit docs page https://tanstack.com/query/latest/docs/framework/solid/guides/request-waterfalls
Expected behavior#
Code example to reference real functions
How often does this bug happen?#
None
Screenshots or Videos#
No response
Platform#
Tanstack Query adapter#
None
TanStack Query version#
5.87.4
TypeScript version#
No response
Additional context#
No response
the solid and vue docs “inherit” everything from the react docs. There are ways to overwrite the code-snippets and also hide parts that don’t match, but someone with knowledge of those frameworks has to please contribute those changes 🙏
TkDodo added labelsdocumentation
TkDodo added labelshelp wanted
Just as a thought, would it be at least useful in the interim to add a warning about that fact to the doc pages?
I am as good as a total newbie to this style of web frontend dev, so don't necessarily know what's right and wrong for any different framework. But such a warning would have been helpful to not get quite so lost in the docs
Hi, I'd like to work on this. Please assign it to me!
Hi @reivilibre , @TkDodo and team! 👋
I've submitted a PR to fix this issue: #9813
What I fixed:
- Replaced the incorrect Vue.js code example with proper SolidJS syntax
- Updated from Vue's
defineComponentandsetup()to SolidJS functional component patterns - Addressed CodeRabbit AI feedback to ensure idiomatic SolidJS implementation
The PR shows the exact changes made to
docs/framework/solid/guides/suspense.mdand includes a proper SolidJS example that works with Suspense boundaries.Would love to get feedback from the community! 🚀
TkDodo closed this
Sign in to join this conversation.
Something similiar on this Page there is Vue Code https://tanstack.com/query/latest/docs/framework/solid/guides/suspense#fetch-on-render-vs-render-as-you-fetch