Skip to content
Compare
Choose a tag to compare
@kitten kitten released this 10 Jun 14:18
3fd4b48

To migrate to the new version, you will now have to pass a single function argument, instead
of two arguments to the withUrqlClient HOC helper. For instance, you would have to transform this:

export default withUrqlClient(
  ctx => ({
    url: '',
  }),
  ssrExchange => [dedupExchange, cacheExchange, ssrExchange, fetchExchange]
);

To look like the following:

export default withUrqlClient((ssrExchange, ctx) => ({
  url: '',
  exchanges: [dedupExchange, cacheExchange, ssrExchange, fetchExchange]
}), { ssr; true });

The second argument may now be used to pass { ssr: true } explicitly, when you are
wrapping a page without another getInitialProps method. This gives you better support
when you're implement custom methods like getStaticProps.

Major Changes

  • Change getInitialProps to be applied when the wrapped page getInitialProps or when { ssr: true } is passed as a second options object. This is to better support alternative methods like getStaticProps. By @JoviDeCroock (See #797)
  • Update the withUrqlClient function to remove the second argument formerly called mergeExchanges and merges it with the first argument.

Patch Changes