import gql from 'graphql-tag' import { graphql, compose } from 'react-apollo' const GetContext = gql` query GetContext($id: String, $lang: ) { getContext(id: $id, lang: $lang) { id } }` const withAppSyncContext = compose( graphql(GetContext, { name: 'getContext', options: (ownProps) => ({ fetchPolicy: 'cache-and-network', variables: { id: ownProps.id, lang: ownProps.lang } }), props: (props) => { if (props.getContext.error) console.log(props.getContext.error) return props } }) ) export { GetContext, withAppSyncContext }