Last active
November 10, 2017 15:19
-
-
Save komkanit/ece4949591c351d7ec3a4267ad631b8a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ApolloClient from 'apollo-client'; | |
import { ApolloLink } from 'apollo-link'; | |
import { HttpLink } from 'apollo-link-http'; | |
import { RetryLink } from 'apollo-link-retry'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
const httpLink = new HttpLink({ | |
uri: 'http://localhost:8080/graphql', | |
headers, | |
credentials: 'include', | |
}); | |
const retry = new RetryLink(); | |
const link = ApolloLink.from([ | |
retry, | |
httpLink, | |
]); | |
// or | |
const link = ApolloLink.concat(retry, httpLink); | |
new ApolloClient({ | |
link, | |
cache: new InMemoryCache(), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment