Assuming you have these two queries:
First Route makes this query:
{
viewer {
items(first: 10) {
edges {
node {
id
title
}
}
}
}
}
Second Route makes this query:
{
viewer {
items(first: 10) {
edges {
node {
id
title
description
}
}
}
}
}
with the default relay network layer, you will end up with 10 (n) node requests like so:
node(id: *id) {
description
}
This is bad. So, the wonderful @nodkz wrote a great network layer, that when paired with some express-js middleware, handles batching.
That's wonderful if we (the collective python graphql users) were using express-js, but alas we are not so we need to implement a solution for such.
The JS implementation can be found here:
https://github.com/nodkz/react-relay-network-layer/blob/master/src/express-middleware/graphqlBatchHTTPWrapper.js
I plan to take a first pass at this tomorrow, but figured I would share with the public in case this has been on anyone else's mind.