import gql from 'graphql-tag' import { graphql, compose } from 'react-apollo' const GetAuthentication = gql` query GetAuthentication($id: String) { getAuthentication(id: $id) { user { guid email nickname name audit } session { id expires_at } } }` const withAppSyncAuthentication = compose( graphql(GetAuthentication, { name: 'getAuthentication', options: (ownProps) => ({ fetchPolicy: 'cache-and-network', variables: { id: ownProps.id } }), props: (props) => { if (props.getAuthentication.error) console.log(props.getAuthentication.error) return props } }) ) export { GetAuthentication, withAppSyncAuthentication }