diff --git a/src/network_interface/ApolloNetworkInterface.ts b/src/network_interface/ApolloNetworkInterface.ts index a94ae5c..dfd76fc 100644 --- a/src/network_interface/ApolloNetworkInterface.ts +++ b/src/network_interface/ApolloNetworkInterface.ts @@ -58,6 +58,11 @@ export function addPersistedQueries(networkInterface: NetworkInterface, queryMap return Object.assign(networkInterface, { query: (request: Request): Promise => { const queryDocument = request.query; + + if (queryDocument === undefined) { + return Promise.reject(new Error('No query document was provided')); + } + const queryKey = getQueryDocumentKey(queryDocument); if (!queryMap[queryKey]) {