import gql from 'graphql-tag' import { graphql, compose } from 'react-apollo' const GetTopic = gql` query GetTopic($offset: Int, $limit: Int, $sortBy: String, $direction: ) { getTopic(offset: $offset, limit: $limit, sortBy: $sortBy, direction: $direction) { page data { name service schema } } }` const GetTopic = gql` query GetTopic($guid: String) { getTopic(guid: $guid) { name service schema } }` const withAppSyncTopic = compose( graphql(GetTopic, { name: 'getTopic', options: (ownProps) => ({ fetchPolicy: 'cache-and-network', variables: { offset: ownProps.offset, limit: ownProps.limit, sortBy: ownProps.sortBy, direction: ownProps.direction } }), props: (props) => { if (props.getTopic.error) console.log(props.getTopic.error) return props } }) ) export { GetTopic, GetTopic, withAppSyncTopic }