From 89568c71e366852f4ad07d7efea4337361c7d5f1 Mon Sep 17 00:00:00 2001 From: nuochong Date: Mon, 14 Dec 2020 14:17:12 +0800 Subject: [PATCH 1/2] fix: eslint path error in workspace --- generator/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/index.js b/generator/index.js index baf4818..060baed 100644 --- a/generator/index.js +++ b/generator/index.js @@ -82,7 +82,7 @@ module.exports = (api, options, rootOptions) => { 'graphql/template-strings': ['error', { env: 'literal', projectName: 'app', - schemaJsonFilepath: 'node_modules/.temp/graphql/schema.json', + schemaJsonFilepath: `${__dirname}/node_modules/.temp/graphql/schema.json`, }], }, }, From e29b6fbea4e9e487e991c52d96ff76e85812e4d2 Mon Sep 17 00:00:00 2001 From: nuochong Date: Thu, 24 Dec 2020 16:29:31 +0800 Subject: [PATCH 2/2] fix: env parameter error --- generator/templates/vue-apollo/default/src/vue-apollo.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generator/templates/vue-apollo/default/src/vue-apollo.js b/generator/templates/vue-apollo/default/src/vue-apollo.js index 1c80b21..34d40e0 100644 --- a/generator/templates/vue-apollo/default/src/vue-apollo.js +++ b/generator/templates/vue-apollo/default/src/vue-apollo.js @@ -7,6 +7,7 @@ Vue.use(VueApollo) // Name of the localStorage item const AUTH_TOKEN = 'apollo-token' +const GRAPHQL_WS = process.env.VUE_APP_GRAPHQL_WS // Http endpoint const httpEndpoint = process.env.VUE_APP_GRAPHQL_HTTP || 'http://localhost:4000/graphql' @@ -22,7 +23,7 @@ const defaultOptions = { httpEndpoint, // You can use `wss` for secure connection (recommended in production) // Use `null` to disable subscriptions - wsEndpoint: process.env.VUE_APP_GRAPHQL_WS || 'ws://localhost:4000/graphql', + wsEndpoint: GRAPHQL_WS === 'null' ? null : GRAPHQL_WS || 'ws://localhost:4000/graphql', // LocalStorage token tokenName: AUTH_TOKEN, // Enable Automatic Query persisting with Apollo Engine