1
Fork 0

Fix ui graphql endpoint env var

This commit is contained in:
viktorstrate 2019-08-09 18:07:14 +02:00
parent d6366f8467
commit 8f7e50c4ba
2 changed files with 7 additions and 11 deletions

View File

@ -1,9 +0,0 @@
module.exports = {
client: {
service: {
name: 'graphql endpoint',
url: process.env.GRAPHQL_ENDPOINT || 'http://localhost:4001/graphql',
skipSSLValidation: true,
},
},
}

View File

@ -8,12 +8,17 @@ import { ApolloLink, split } from 'apollo-link'
import { getMainDefinition } from 'apollo-utilities' import { getMainDefinition } from 'apollo-utilities'
const httpLink = new HttpLink({ const httpLink = new HttpLink({
uri: process.env.REACT_APP_GRAPHQL_URI, uri: process.env.GRAPHQL_ENDPOINT,
credentials: 'same-origin', credentials: 'same-origin',
}) })
console.log('GRAPHQL ENDPOINT', process.env.GRAPHQL_ENDPOINT)
let websocketUri = new URL(process.env.GRAPHQL_ENDPOINT)
websocketUri.protocol = 'ws'
const wsLink = new WebSocketLink({ const wsLink = new WebSocketLink({
uri: `ws://localhost:4001/graphql`, uri: websocketUri,
credentials: 'same-origin', credentials: 'same-origin',
options: { options: {
reconnect: true, reconnect: true,