import gql from 'graphql-tag' import { graphql, compose } from 'react-apollo' const GetRepository = gql` query GetRepository($page: Int, $visibility: visibility, $affiliation: String, $type: String, $sort: String, $direction: String) { getRepository(page: $page, visibility: $visibility, affiliation: $affiliation, type: $type, sort: $sort, direction: $direction) { } }` const GetRepository = gql` query GetRepository($username: String, $page: Int, $type: String, $sort: String, $direction: String) { getRepository(username: $username, page: $page, type: $type, sort: $sort, direction: $direction) { } }` const GetRepository = gql` query GetRepository($org: String, $page: Int, $type: String, $sort: String, $direction: String) { getRepository(org: $org, page: $page, type: $type, sort: $sort, direction: $direction) { } }` const withAppSyncRepository = compose( graphql(GetRepository, { name: 'getRepository', options: (ownProps) => ({ fetchPolicy: 'cache-and-network', variables: { page: ownProps.page, visibility: ownProps.visibility, affiliation: ownProps.affiliation, type: ownProps.type, sort: ownProps.sort, direction: ownProps.direction } }), props: (props) => { if (props.getRepository.error) console.log(props.getRepository.error) return props } }) ) export { GetRepository, GetRepository, GetRepository, withAppSyncRepository }