But it's very tiresome to include the restore and setClient calls on every page. Is it possible to define some kind of middleware which instantiates a client-side ApolloClient() instance and hydrates it from cache.dataif the preload function returned a cache attribute?
I don't know svelte / sapper well enough to know if this is possible, but it seems like it should be!
The example from the docs mostly works for me:
But it's very tiresome to include the
restore
andsetClient
calls on every page. Is it possible to define some kind of middleware which instantiates a client-sideApolloClient()
instance and hydrates it fromcache.data
if the preload function returned acache
attribute?I don't know svelte / sapper well enough to know if this is possible, but it seems like it should be!