Skip to content

Commit 0ecd298

Browse files
committed
Worker: Catch apollo proxy message
1 parent bf1e92c commit 0ecd298

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

app/middlewares/debuggerAPI.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ const onWindowMessage = e => {
6666
const { data } = e;
6767
if (data && data.source === APOLLO_PROXY) {
6868
const message = typeof data.payload === 'string' ? { event: data.payload } : data.payload;
69-
worker.postMessage({ source: APOLLO_PROXY, ...message });
69+
worker.postMessage({
70+
method: 'emitApolloMessage',
71+
source: APOLLO_PROXY,
72+
...message,
73+
});
7074
}
7175
};
7276

app/worker/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ const messageHandlers = {
8282
// pass to other listeners
8383
return true;
8484
},
85+
emitApolloMessage() {
86+
// pass to other listeners
87+
return true;
88+
},
8589
invokeDevMenuMethod({ name, args }) {
8690
invokeDevMenuMethodIfAvailable(name, args);
8791
return false;

0 commit comments

Comments
 (0)