At the moment, our client makes separate HTTP POST requests for each component's GraphQL query.
Apollo Client offers a apollo-link-batch-http
package to help us here.
-
Install the package.
-
Import it into your
index.js
:import { BatchHttpLink } from "apollo-link-batch-http";
-
Instantiate a
new BatchHttpLink()
instead of anew HttpLink()
. -
Test your code.