import gql from 'graphql-tag' import { graphql, compose } from 'react-apollo' const GetWalletBalance = gql` query GetWalletBalance($stakingAddress: String) { getWalletBalance(stakingAddress: $stakingAddress) { balance } }` const withAppSyncWalletBalance = compose( graphql(GetWalletBalance, { name: 'getWalletBalance', options: (ownProps) => ({ fetchPolicy: 'cache-and-network', variables: { stakingAddress: ownProps.stakingAddress } }), props: (props) => { if (props.getWalletBalance.error) console.log(props.getWalletBalance.error) return props } }) ) export { GetWalletBalance, withAppSyncWalletBalance }