Created
September 7, 2019 19:46
-
-
Save AndrewRayCode/0677a290df026658aa2707e6cf58b9c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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