import gql from 'graphql-tag' import { graphql, compose } from 'react-apollo' const GetService = gql` query GetService($offset: Int, $limit: Int, $sortBy: String, $direction: ) { getService(offset: $offset, limit: $limit, sortBy: $sortBy, direction: $direction) { } }` const GetService = gql` query GetService($name: String) { getService(name: $name) { name version state type uri title description } }` const GetService = gql` query GetService($name: String) { getService(name: $name) { } }` const withAppSyncService = compose( graphql(GetService, { name: 'getService', options: (ownProps) => ({ fetchPolicy: 'cache-and-network', variables: { offset: ownProps.offset, limit: ownProps.limit, sortBy: ownProps.sortBy, direction: ownProps.direction } }), props: (props) => { if (props.getService.error) console.log(props.getService.error) return props } }) ) export { GetService, GetService, GetService, withAppSyncService }