Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Apollo Client Cache Rehydration in Razzle with SSR #1901

Open
mbzr opened this issue Oct 30, 2022 · 1 comment
Open

Using Apollo Client Cache Rehydration in Razzle with SSR #1901

mbzr opened this issue Oct 30, 2022 · 1 comment

Comments

@mbzr
Copy link

mbzr commented Oct 30, 2022

❓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?

@fivethreeo
Copy link
Collaborator

apollographql/apollo-client#10231

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

No branches or pull requests

2 participants