Skip to content

Commit d661e96

Browse files
Poincarehelfer
authored andcommitted
[WIP] Added transport batching (#79)
* added transport batching * fix typo in call to makeExecutableSchema * changed to the new way to create a network interface * remove api folder (again)
1 parent 19a22ef commit d661e96

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

ui/client.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ function logPageView() {
2020
}
2121

2222
const client = new ApolloClient({
23-
networkInterface: createNetworkInterface('/graphql', {
24-
credentials: 'same-origin',
23+
networkInterface: createNetworkInterface({
24+
uri: '/graphql',
25+
opts: {
26+
credentials: 'same-origin',
27+
},
28+
transportBatching: true
2529
}),
2630
queryTransformer: addTypename,
2731
dataIdFromObject: (result) => {

webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ module.exports = {
1111
}, {
1212
test: /\.js$/,
1313
loader: 'babel',
14-
exclude: /node_modules/
14+
// Exclude apollo client from the webpack config in case
15+
// we want to use npm link.
16+
exclude: /(node_modules)|(apollo-client)/
1517
}, {
1618
test: /\.json$/,
1719
loader: 'json'

0 commit comments

Comments
 (0)