Quasar Framework v1中的Setp Apollo graphql

我正在尝试将vue apollo安装为类星体中的启动程序

启动文件:src/boot/vue-apollo.js

import VueApollo from 'vue-apollo'
import ApolloClient from 'apollo-boost'

const apolloClient = new ApolloClient({
  uri: process.env.GRQPHQL_API
})

const apolloProvider = new VueApollo({
  defaultClient: apolloClient
})

export default async ({ Vue,app }) => {
  Vue.use(VueApollo)
  app.apolloProvider = apolloProvider
}

错误:

These dependencies were not found:

* graphql/language/parser in ./node_modules/graphql-tag/src/index.js
* graphql/language/printer in ./node_modules/apollo-link-http-common/lib/bundle.esm.js
* graphql/language/visitor in ./node_modules/apollo-client/bundle.esm.js,./node_modules/apollo-utilities/lib/bundle.esm.js

To install them,you can run: npm install --save graphql/language/parser graphql/language/printer graphql/language/visitor

我找到了一个解决方案:安装graphql软件包npm install --save graphql,但是不起作用

hitzhaotianxu 回答:Quasar Framework v1中的Setp Apollo graphql

我遇到了同样的问题,并且能够通过从Quasar卸载Apollo Client应用程序扩展来解决此问题:

const personProfile = document.data().personProfile.subStr(
     15,document.data().personProfile.length
);

然后重新安装应用程序扩展名:

quasar ext remove @quasar/apollo

我希望这对某人有帮助。

,

我刚刚使用Apollo Boost和Vue Apollo设置了Quasar,但无法复制您正在描述的问题。

这是我的步骤:

  1. 使用quasar cli工具设置的新项目
  2. yarn add vue-apollo graphql apollo-boost
  3. 与您完全一样的引导文件(仅与我的graphql uri一起),添加到boot中的quasar.conf.js数组中

工作正常。我什至尝试删除env变量的值,只是为了覆盖所有基础。

请参阅以下quasar info的输出以获取我的配置。

Operating System - Linux(5.3.11-300.fc31.x86_64) - linux/x64
NodeJs - 12.13.0

Global packages
  NPM - 6.12.0
  yarn - 1.17.3
  @quasar/cli - 1.0.0-beta.2
  cordova - Not installed

Important local packages
  quasar - 1.4.5 -- Build high-performance VueJS user interfaces (SPA,PWA,SSR,Mobile and Desktop) in record time
  @quasar/app - 1.2.4 -- Quasar Framework local CLI
  @quasar/extras - 1.3.3 -- Quasar Framework fonts,icons and animations
  vue - 2.6.10 -- Reactive,component-oriented view layer for modern web interfaces.
  vue-router - 3.1.3 -- Official router for Vue.js 2
  vuex - 3.1.1 -- state management for Vue.js
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed
  @babel/core - 7.7.4 -- Babel compiler core.
  webpack - 4.41.2 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles,which can be loaded on demand. Support loaders to preprocess files,i.e. json,jsx,es7,css,less,... and your custom stuff.
  webpack-dev-server - 3.9.0 -- Serves a webpack app. Updates the browser on changes.
  workbox-webpack-plugin - 4.3.1 -- A plugin for your Webpack build process,helping you generate a manifest of local files that workbox-sw should precache.
  register-service-worker - 1.6.2 -- Script for registering service worker,with hooks

Quasar App Extensions
  *None installed*

我希望这会有所帮助。

本文链接:https://www.f2er.com/3159738.html

大家都在问