1- import { ApolloCache , DataProxy , Cache } from 'apollo-cache' ;
1+ import { ApolloCache , Cache , DataProxy , Transaction } from 'apollo-cache' ;
22import { addTypenameToDocument } from 'apollo-utilities' ;
3- import { DocumentNode } from 'graphql' ;
43import * as deepmerge from 'deepmerge' ;
4+ import { DocumentNode } from 'graphql' ;
55
6- import { CacheStore , SerialisedState , QueryStore } from './cache-interfaces' ;
6+ import { CacheStore , QueryStore , SerialisedState } from './cache-interfaces' ;
77import { getCacheableNodes , getDefaultIdFromNode , getHashForQuery } from './utils' ;
88
99export interface ApolloCacheLiteOptions {
@@ -28,8 +28,8 @@ export class ApolloCacheLite extends ApolloCache<SerialisedState> {
2828 const result = this . read ( query as Cache . ReadOptions < any > ) ;
2929
3030 return {
31- result,
32- complete : ! ! result
31+ complete : ! ! result ,
32+ result
3333 } ;
3434 }
3535
@@ -64,7 +64,7 @@ export class ApolloCacheLite extends ApolloCache<SerialisedState> {
6464 const [ type , id ] = options . id . split ( ':' ) ;
6565 return this . store [ type ] [ id ] as T ;
6666
67- } catch ( o_O ) {
67+ } catch ( e ) {
6868 return ;
6969 }
7070 }
@@ -88,7 +88,7 @@ export class ApolloCacheLite extends ApolloCache<SerialisedState> {
8888 queries : this . queries ,
8989 store : this . store
9090 } ;
91- } catch ( o_O ) { }
91+ } catch ( e ) { }
9292
9393 return this ;
9494 }
@@ -105,15 +105,18 @@ export class ApolloCacheLite extends ApolloCache<SerialisedState> {
105105
106106 // @TODO
107107 evict < TVariables = any > ( query : Cache . EvictOptions < TVariables > ) : Cache . EvictionResult {
108- throw new Error ( " Method not implemented." ) ;
108+ throw new Error ( '[apollo-cache-lite] Method not implemented!' ) ;
109109 }
110+
110111 removeOptimistic ( id : string ) : void {
111- throw new Error ( " Method not implemented." ) ;
112+ throw new Error ( '[apollo-cache-lite] Method not implemented!' ) ;
112113 }
113- performTransaction ( transaction : import ( "apollo-cache" ) . Transaction < SerialisedState > ) : void {
114- throw new Error ( "Method not implemented." ) ;
114+
115+ performTransaction ( transaction : Transaction < SerialisedState > ) : void {
116+ throw new Error ( '[apollo-cache-lite] Method not implemented!' ) ;
115117 }
116- recordOptimisticTransaction ( transaction : import ( "apollo-cache" ) . Transaction < SerialisedState > , id : string ) : void {
117- throw new Error ( "Method not implemented." ) ;
118+
119+ recordOptimisticTransaction ( transaction : Transaction < SerialisedState > , id : string ) : void {
120+ throw new Error ( '[apollo-cache-lite] Method not implemented!' ) ;
118121 }
119122}
0 commit comments