feat(ui): update to latest vue-cli-plugin-apollo

This commit is contained in:
Guillaume Chau
2018-05-25 01:44:18 +02:00
parent 80c2c7a7f0
commit 873d14d22d
6 changed files with 14 additions and 11 deletions

View File

@@ -1 +1 @@
VUE_APP_GRAPHQL_WS=
VUE_CLI_UI_URL=

View File

@@ -31,7 +31,7 @@
"semver": "^5.5.0",
"shortid": "^2.2.8",
"terminate": "^2.1.0",
"vue-cli-plugin-apollo": "^0.10.0",
"vue-cli-plugin-apollo": "^0.11.0",
"watch": "^1.0.2"
},
"devDependencies": {

View File

@@ -6,7 +6,7 @@ const { resolveModuleRoot } = require('../utils/resolve-path')
let addons = []
let baseUrl = process.env.VUE_APP_GRAPHQL_WS
let baseUrl = process.env.VUE_CLI_UI_URL
if (typeof baseUrl === 'undefined') {
baseUrl = 'http://localhost:4000'
} else {

View File

@@ -5,7 +5,7 @@ import { createApolloClient } from 'vue-cli-plugin-apollo/graphql-client'
// Install the vue plugin
Vue.use(VueApollo)
let endpoint = process.env.VUE_APP_GRAPHQL_WS
let endpoint = process.env.VUE_CLI_UI_URL
if (typeof endpoint === 'undefined') {
endpoint = 'ws://localhost:4000/graphql'
} else if (endpoint === '') {

View File

@@ -8,9 +8,7 @@ async function ui (options = {}, context = process.cwd()) {
}
// Config
process.env.VUE_APP_GRAPHQL_PORT = port
process.env.VUE_APP_GRAPHQL_WS = ''
process.env.VUE_APP_GRAPHQL_PLAYGROUND_PATH = '/graphql-playground'
process.env.VUE_CLI_UI_URL = ''
if (!options.dev) {
process.env.NODE_ENV = 'production'
@@ -21,6 +19,11 @@ async function ui (options = {}, context = process.cwd()) {
server = server.default || server
const opts = {
port,
graphqlPath: '/graphql',
graphqlSubscriptionsPath: '/graphql',
graphqlPlaygroundPath: '/graphql-playground',
graphqlCors: '*',
mock: false,
apolloEngine: false,
timeout: 1000000,
@@ -35,7 +38,7 @@ async function ui (options = {}, context = process.cwd()) {
}
server(opts, () => {
const url = `http://localhost:${process.env.VUE_APP_GRAPHQL_PORT}`
const url = `http://localhost:${port}`
if (!options.quiet) log(`🌠 Ready on ${url}`)
if (options.headless) {
console.log(port)

View File

@@ -11442,9 +11442,9 @@ vue-class-component@^6.0.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/vue-class-component/-/vue-class-component-6.2.0.tgz#7adb1daa9a868c75f30f97f33f4f1b94aee62089"
vue-cli-plugin-apollo@^0.10.0:
version "0.10.3"
resolved "https://registry.yarnpkg.com/vue-cli-plugin-apollo/-/vue-cli-plugin-apollo-0.10.3.tgz#4b43c33fe64eae21c5b321fe3b0a475e12897f9c"
vue-cli-plugin-apollo@^0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/vue-cli-plugin-apollo/-/vue-cli-plugin-apollo-0.11.0.tgz#13d390006fd44245ce4914548a0d4a11bf5198bf"
dependencies:
apollo-cache-inmemory "^1.2.1"
apollo-client "^2.3.1"