quinnvaughn
How to integrate Apollo Client into Solid Start with SSR?
Basically you're grabbing all the queries ahead of time and using that to hydrate the initial state, which you inject into the window for the client side cache to set its initial values with
30 replies
How to integrate Apollo Client into Solid Start with SSR?
So like we generate a list of things, which should remove the list on the sidebar completely and replace them with the new list, but that's not the top level query for the sidebar. But the client side cache is completely unaware that those things exist because the mutation is on the client but the data was initially gotten on the server side.
30 replies
How to integrate Apollo Client into Solid Start with SSR?
Well the issue isn't for multiple queries. It's that the initial data is being gotten on the server, so the client side cache is completely unaware of it when you then try to update the cache after a mutation.
30 replies
How to integrate Apollo Client into Solid Start with SSR?
Well an alternative to our solution is that literally we just don't use ssr, however I still get issues like this on dev - https://github.com/solidjs/solid-start/issues/519, which is clearly not fixed. We have zero need for SEO etc, this is purely a dashboard view for our clients.
30 replies
How to integrate Apollo Client into Solid Start with SSR?
https://codesandbox.io/p/devbox/solid-start-urql-dnjcly this is what I have so far. Not the best example since you can't mutate that API but will do for this I guess.
30 replies
How to integrate Apollo Client into Solid Start with SSR?
Side note - the default Code Sandbox template for Solid Start doesn't work, you may want to reach out to someone there about it.
"Error when evaluating SSR module $vinxi/handler/ssr:
|- Error: Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>."
It doesn't look obviously wrong though.
Edit: Upgrading all dependencies worked though.
30 replies
How to integrate Apollo Client into Solid Start with SSR?
So I switched this to urql because it seemed slightly easier to integrate but still same issue - does anyone from the start team know how to do this? @Brendonovich (I can't seem to @ that role). Re urql I'd have to add an equivalent to the prepass function but StartServer doesn't seemingly accept that being async. https://commerce.nearform.com/open-source/urql/docs/advanced/server-side-rendering/
30 replies
How to integrate Apollo Client into Solid Start with SSR?
You get
const first = html.indexOf(marker);
^
TypeError: Cannot read properties of undefined (reading 'indexOf')
doing nothing but changing it to createHandler(async () => {...etc}). mode: 'async' inside StartServer doesn't seem to change that fact.
30 replies