Skip to content

Commit 855ee3e

Browse files
committed
2.9.2
2.9.2 - 2017-10-17 ----------------------------------------------- ## Server * Setting `ctx.apollo.networkOptions` via a function passed to `config.addBeforeMiddleware()` will now get passed to the call to Apollo's `createNetworkInterface()` when using a third-party GraphQL server, enabling dynamic per-request CORS / authorisation logic, as needed
1 parent 78a079a commit 855ee3e

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2.9.2 - 2017-10-17
2+
-----------------------------------------------
3+
4+
## Server
5+
* Setting `ctx.apollo.networkOptions` via a function passed to `config.addBeforeMiddleware()` will now get passed to the call to Apollo's `createNetworkInterface()` when using a third-party GraphQL server, enabling dynamic per-request CORS / authorisation logic, as needed
6+
17
2.9.1 - 2017-10-17
28
-----------------------------------------------
39

kit/entry/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ const createNeworkInterface = (() => {
120120
);
121121
}
122122

123-
function externalInterface() {
124-
return getNetworkInterface(config.graphQLEndpoint);
123+
function externalInterface(ctx) {
124+
return getNetworkInterface(config.graphQLEndpoint, ctx.apollo.networkOptions);
125125
}
126126

127127
return config.graphQLServer ? localInterface : externalInterface;

kit/lib/apollo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export function createClient(opt = {}) {
2525
}
2626

2727
// Wrap `createNetworkInterface` to attach middleware
28-
export function getNetworkInterface(uri) {
28+
export function getNetworkInterface(uri, opt) {
2929
const networkInterface = createNetworkInterface({
3030
uri,
31-
opts: config.apolloNetworkOptions,
31+
opts: Object.assign({}, config.apolloNetworkOptions, opt),
3232
});
3333

3434
// Attach middleware

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactql-app",
3-
"version": "2.9.1",
3+
"version": "2.9.2",
44
"description": "ReactQL starter kit app",
55
"license": "UNLICENSED",
66
"private": true,

0 commit comments

Comments
 (0)