import { ApolloError , ApolloQueryResult } from 'apollo-client' ; import { DocumentNode } from 'graphql' ; import { Observable } from 'rxjs' ; /**
 * Apollo request
 */ export interface ApolloRequest { /**
     * Request entities
     */ keys ? : string [ ] ; /**
     * Request query
     */ query : DocumentNode ; } /**
 * API Response
 */ export type ApolloResponse < T = any , R extends ApolloError = ApolloError > = Observable < T | R > ; param result param entitiesKeys export function extractApolloResponse < T = any > ( result , entitiesKeys ? ) { const keys = ! entitiesKeys ? Object . keys ( entitiesKeys ) : entitiesKeys ; return keys . length === 1 ? result . data [ keys [ 0 ] ] : result . data ; }