Skip to content

Commit

Permalink
feat(ui): update to latest vue-cli-plugin-apollo
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed May 24, 2018
1 parent 80c2c7a commit 873d14d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/@vue/cli-ui/.env.production
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VUE_APP_GRAPHQL_WS=
VUE_CLI_UI_URL=
2 changes: 1 addition & 1 deletion packages/@vue/cli-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-ui/src/vue-apollo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '') {
Expand Down
11 changes: 7 additions & 4 deletions packages/@vue/cli/lib/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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,
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 873d14d

Please sign in to comment.