Releases: relay-tools/react-relay-network-modern
v4.3.0
v4.2.0
v4.1.0
v4.0.4
v4.0.3
v4.0.2
v4.0.1
v4.0.0
4.0.0 (2019-06-11)
Safe to upgrade if you don't use batchMiddleware
. If you use batchMiddleware
you should use legacyBatchMiddleware
or change batching response on your server.
BREAKING CHANGES
- batchMiddleware: batch request list as array & check duplicates comparing body
How batching works internally from v4.0.0
Internally batching in NetworkLayer prepare list of queries [ {id, query, variables}, ...]
sends it to server. And server returns list of responces [ {id, payload}, ...]
, (where id
is the same value as client requested for identifying which data goes with which query, and payload
is standard response of GraphQL server: { data, error }
). Internally batching in NetworkLayer
prepare list of queries [ {query, variables}, ...]
sends it to server. And server returns list of results [ {data}, ...]
. The server is expected to return the results in the same order as the requests.
As of v4.0.0, the batch middleware utilizing request IDs in queries and corresponding results has been renamed legacyBatchMiddleware
. The legacy middleware included a request ID with each query included in the batch and expected the server to return each result with the corresponding request ID. The new batchMiddleware
simply expects results be returned in the same order as the batched queries.
NOTE: legacyBatchMiddleware
does not correctly deduplicate queries when batched because query variables may be ignored in a comparison. This means that two identical queries with different variables will show the same results due to a bug (#31). It is highly encouraged to use the new order-based batchMiddleware
, which still deduplicates queries, but includes the variables in the comparison.