import gql from 'graphql-tag' import { graphql, compose } from 'react-apollo' const GetPoolUpdate = gql` query GetPoolUpdate($blockNumberFrom: Int, $limit: Int) { getPoolUpdate(blockNumberFrom: $blockNumberFrom, limit: $limit) { } }` const GetPoolUpdate = gql` query GetPoolUpdate($poolId: String, $blockNumberFrom: Int, $limit: Int) { getPoolUpdate(poolId: $poolId, blockNumberFrom: $blockNumberFrom, limit: $limit) { } }` const GetPoolUpdate = gql` query GetPoolUpdate($blockNumberFrom: Int, $limit: Int) { getPoolUpdate(blockNumberFrom: $blockNumberFrom, limit: $limit) { } }` const withAppSyncPoolUpdate = compose( graphql(GetPoolUpdate, { name: 'getPoolUpdate', options: (ownProps) => ({ fetchPolicy: 'cache-and-network', variables: { blockNumberFrom: ownProps.blockNumberFrom, limit: ownProps.limit } }), props: (props) => { if (props.getPoolUpdate.error) console.log(props.getPoolUpdate.error) return props } }) ) export { GetPoolUpdate, GetPoolUpdate, GetPoolUpdate, withAppSyncPoolUpdate }