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; }