jaredpalmer/razzle

Using Apollo Client Cache Rehydration in Razzle with SSR

mbzr opened this issue · 1 comments

mbzr commented

❓Question

I am using Apollo Client with Server-side Rendering but it seems Apollo Client's useQuery hooks are never called on the server side with razzle. All the queries are instead only called on the client side.

To solve this in Next.js, I could call the query on server-side like so:

export async function getServerSideProps() {
    const client = initializeApollo()
    const query = await client.query({query: USER_QUERY })
}

Is there a solution to this in razzle?