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

Excessive GraphQL calls on server side rendering #322

Open
MrOrz opened this issue Aug 26, 2020 · 1 comment
Open

Excessive GraphQL calls on server side rendering #322

MrOrz opened this issue Aug 26, 2020 · 1 comment

Comments

@MrOrz
Copy link
Member

MrOrz commented Aug 26, 2020

Although we have set {ssr: false} to some query, it's still invoked in server-side rendering. This puts extra load to SSR server.

image

Logger added to BatchHttpLink:

fetch: (uri, options) => {
  console.log(
    'FETCH',
    options.body &&
      (JSON.parse(options.body) || []).map(
      ({ operationName }) => operationName
    )
  );
  return fetch(uri, options);
}

Related issue: apollographql/react-apollo#3130, apollographql/react-apollo#3500

@eric-burel
Copy link

I seem to have a similar issue when setting up Material UI SSR + next-i18nnext SSR. The way Apollo detects SSR seems to be broken in certain scenarios when playing too much with React SSR, it might change some internal state

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