mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
27 lines
694 B
JavaScript
27 lines
694 B
JavaScript
import { createUploadLink } from 'apollo-upload-client'
|
|
import { ApolloClient } from 'apollo-client'
|
|
import { InMemoryCache } from 'apollo-cache-inmemory'
|
|
|
|
export default ({ app }) => {
|
|
const backendUrl = process.env.GRAPHQL_URI || 'http://localhost:4000'
|
|
const link = createUploadLink({ uri: 'http://localhost:4000' })
|
|
|
|
const client = new ApolloClient({
|
|
link,
|
|
cache: new InMemoryCache(),
|
|
})
|
|
|
|
console.log(client)
|
|
return {
|
|
client,
|
|
httpEndpoint: process.server ? backendUrl : '/api',
|
|
httpLinkOptions: {
|
|
credentials: 'same-origin'
|
|
},
|
|
credentials: true,
|
|
tokenName: 'human-connection-token',
|
|
persisting: false,
|
|
websocketsOnly: false
|
|
}
|
|
}
|