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

Compatible with apollo@3 hooks ? #67

Closed
Ziker22 opened this issue May 3, 2021 · 2 comments
Closed

Compatible with apollo@3 hooks ? #67

Ziker22 opened this issue May 3, 2021 · 2 comments

Comments

@Ziker22
Copy link

Ziker22 commented May 3, 2021

Hello im trying to make prepass work with apollo 3(useQuery hook) together with nextjs
I took this from docs

ssrPrepass(<App />, (element, instance) => {
 if (instance && instance.fetchData) {
    return instance.fetchData()
  }
})

My problem is since im using hooks instances of my components doesnt seem to have fetchData property
Is there any chance i can check different condition ? Or should i switch to apollos Query component ? Or theres no way to make this work ?

Any advice will be highly appreciated :)

@bregenspan
Copy link

bregenspan commented May 3, 2021

@Ziker22 based on e04b17b and my own attempts to reconcile Apollo 3 + react-ssr-prepass, I believe that there's no longer a supported answer for this, regardless of whether you use the Hooks-based approach or Query components.

(But I'd also love to hear if anyone has somehow figured out a decent workaround that allows for react-ssr-prepass X Apollo 3 compatibility)

@kitten
Copy link
Contributor

kitten commented May 3, 2021

Well, Apollo doesn't support Suspense as far as I know, especially suspense during SSR is what react-ssr-prepass would need it to work, so unfortunately all the old docs sections (that were removed) for react-apollo v2 don't apply anymore

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

3 participants