import gql from 'graphql-tag' import { graphql, compose } from 'react-apollo' const GetItem = gql` query GetItem($q: String, $limit: Int, $offset: Int) { getItem(q: $q, limit: $limit, offset: $offset) { } }` const GetItem = gql` query GetItem($guid: String) { getItem(guid: $guid) { guid detail label description } }` const withAppSyncItem = compose( graphql(GetItem, { name: 'getItem', options: (ownProps) => ({ fetchPolicy: 'cache-and-network', variables: { q: ownProps.q, limit: ownProps.limit, offset: ownProps.offset } }), props: (props) => { if (props.getItem.error) console.log(props.getItem.error) return props } }) ) export { GetItem, GetItem, withAppSyncItem }