2.0.0 (2018-03-03)
New
- add
beforeFetch
option to RelayNetworkLayer(middlewares, { beforeFetch })
. (c4b6f2c)
Code Refactoring
- rename
gqlErrorsMiddleware
to errorMiddleware
(5a5c3f5)
BREAKING CHANGES
- renamed
gqlErrorsMiddleware
to errorMiddleware
subscribeFn
should be provided as named option
Migration guide from v1 to v2
1. Rename gqlErrorsMiddleware
to errorMiddleware
- import { RelayNetworkLayer, gqlErrorsMiddleware } from 'react-relay-network-modern';
+ import { RelayNetworkLayer, errorMiddleware } from 'react-relay-network-modern';
- const network = new RelayNetworkLayer([ gqlErrorsMiddleware() ]);
+ const network = new RelayNetworkLayer([ errorMiddleware() ]);
2. If you use subscriptions provide subscribeFn
as named option:
- const network = new RelayNetworkLayer(middlewares, subscribeFn);
+ const network = new RelayNetworkLayer(middlewares, { subscribeFn });