123456789101112131415161718192021222324252627282930313233343536373839 |
- /**
- * Using next-with-apollo
- * https://github.com/lfades/next-with-apollo
- *
- * Changes:
- * * Reading endpoint and prodEndpoint from a config file
- * * Setting request to handle credentials.
- */
- // import { withData } from 'next-apollo'
- // import { HttpLink } from 'apollo-boost'
- // import { ApolloLink } from 'apollo-link'
- // import { onError } from 'apollo-link-error'
- import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'
- const client = new ApolloClient({
- cache: new InMemoryCache(),
- link: new HttpLink({
- uri: 'http://localhost:8801/',
- credentials: 'include'
- })
- })
- // const errorLink = onError(errors => { })
- // const httpLink = new HttpLink({
- // uri: 'http://localhost:8801/',
- // credentials: 'include'
- // })
- // const config = {
- // link: ApolloLink.from([
- // errorLink,
- // httpLink
- // ])
- // }
- export default client
|