import gql from 'graphql-tag' import { graphql, compose } from 'react-apollo' const GetHello = gql` query GetHello() { getHello() { id name } }` const PostHello = gql` mutation PostHello() { postHello() { id name } }` const withAppSyncHello = compose( graphql(GetHello, { name: 'getHello', options: (ownProps) => ({ fetchPolicy: 'cache-and-network', variables: { } }), props: (props) => { if (props.getHello.error) console.log(props.getHello.error) return props } }) ) export { GetHello, PostHello, withAppSyncHello }