From 9e1ba06eef3fdefcd9bd8c0fb0d16543d56e63d5 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Mon, 29 Jan 2018 22:59:10 -0500 Subject: [PATCH] Temporary change to at least let FFZ finish loading with the wrong Apollo version. --- src/utilities/compat/apollo.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utilities/compat/apollo.js b/src/utilities/compat/apollo.js index 2c2c2d9d..fd9c896d 100644 --- a/src/utilities/compat/apollo.js +++ b/src/utilities/compat/apollo.js @@ -66,6 +66,11 @@ export default class Apollo extends Module { }*/ // Register middleware so that we can intercept requests. + if ( ! this.client.networkInterface ) { + this.log.error('Apollo does not have NetworkInterface. We are unable to manipulate queries.'); + return; + } + this.client.networkInterface.use([{ applyBatchMiddleware: (req, next) => { if ( this.enabled ) @@ -195,6 +200,11 @@ export default class Apollo extends Module { query_id = name_map && name_map[operation], query = query_map && query_map[query_id]; + if ( ! query_map && ! this.warn_qm ) { + this.log.error('Unable to find the Apollo query map. We cannot access data properly.'); + this.warn_qm = true; + } + return query && query.observableQuery; }