import gql from 'graphql-tag' import { graphql, compose } from 'react-apollo' const GetVenue = gql` query GetVenue($clientId: String, $clientSecret: String, $v: String, $near: String, $query: String) { getVenue(clientId: $clientId, clientSecret: $clientSecret, v: $v, near: $near, query: $query) { response { groups { items { venue { name id bestPhoto { prefix suffix width height } } } } } } }` const GetVenue = gql` query GetVenue($venueId: String, $clientId: String, $clientSecret: String, $v: String) { getVenue(venueId: $venueId, clientId: $clientId, clientSecret: $clientSecret, v: $v) { response { venue { name id bestPhoto { prefix suffix width height } } } } }` const withAppSyncVenue = compose( graphql(GetVenue, { name: 'getVenue', options: (ownProps) => ({ fetchPolicy: 'cache-and-network', variables: { clientId: ownProps.clientId, clientSecret: ownProps.clientSecret, v: ownProps.v, near: ownProps.near, query: ownProps.query } }), props: (props) => { if (props.getVenue.error) console.log(props.getVenue.error) return props } }) ) export { GetVenue, GetVenue, withAppSyncVenue }