Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
Created September 7, 2019 19:46
Show Gist options
  • Save AndrewRayCode/0677a290df026658aa2707e6cf58b9c9 to your computer and use it in GitHub Desktop.
Save AndrewRayCode/0677a290df026658aa2707e6cf58b9c9 to your computer and use it in GitHub Desktop.
import withApolloSSR from '../../withApolloSSR';
import { compose, graphql } from 'react-apollo';
...
const GameHomepage = () => <div>My game...</div>
export default compose(
withApolloSSR,
graphql(GAME_GRAPHQL_QUERY,)
)(GameHomepage);
import { withData } from './next-apollo';
import { HttpLink } from 'apollo-link-http';
const config = {
link: new HttpLink({
uri: __SERVER__
? 'http://host.docker.internal:4000/graphql'
: 'http://localhost:4000/graphql',
opts: {
credentials: 'same-origin' // Additional fetch() options like `credentials` or `headers`
}
})
};
export default withData(config);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment