Skip to content

v2.0.0

Compare
Choose a tag to compare
@nodkz nodkz released this 14 Mar 17:21

2.0.0 (2017-03-14)

Breaking Changes

  • completely rewritten batch logic as middleware, added additional cool options to it batchTimeout, maxBatchSize (b903597e)
  • throw Error object on non-200 response (before thrown response)
  • bunch of small fixes, refactoring, cleanups (a5b6f1b2)

If you use request batching, you should change your config:

import Relay from 'react-relay';
import {
  RelayNetworkLayer,
  urlMiddleware,
+  batchMiddleware,
} from 'react-relay-network-layer';

Relay.injectNetworkLayer(new RelayNetworkLayer([
+  batchMiddleware({
+    batchUrl: (req) => '/graphql/batch',
+  }),
  urlMiddleware({
    url: (req) => '/graphql',
-    batchUrl: (req) => '/graphql/batch',
  }),
- ], { disableBatchQuery: false }));
+ ]));

Big thanks to @brad-decker and @jeanregisser in helping to done this release.