vue-cli-plugin-apollo is a Vue CLI 3.x plugin that streamlines the integration of Apollo Client and GraphQL into Vue.js projects. It automates much of the boilerplate setup, including configuring Apollo Client with features like WebSockets, file uploads, and client-side state management (via apollo-link-state). The plugin also offers an optional, customizable GraphQL server based on Apollo Server, complete with automatic mocking, Apollo Engine support, and an integrated GraphQL Playground in the CLI UI. It provides commands for schema generation and publishing. The current stable version is 0.22.2, with an active but irregular release cadence focused on maintenance, bug fixes, and updates to underlying Apollo libraries. Its key differentiator is the rapid, opinionated setup it provides for full-stack GraphQL development with Vue, significantly reducing manual configuration.
npm install vue-cli-plugin-apolloVerified import paths — ran on the pinned version, not inferred.
Demonstrates `vue add vue-cli-plugin-apollo` followed by basic Apollo Client setup and a Vue Composition API component fetching data using `useQuery` and `gql`.
Update any custom Apollo Link configurations or `getAuth` functions to ensure the 'Authorization' header uses correct capitalization.
Consult the Apollo Server and Apollo Upload Client changelogs for specific migration instructions for versions 2.3.x and 10.x respectively. Review server-side schema definitions, resolvers, and file upload handling.
Review `vue.config.js` for any custom `vue-loader` configurations that might conflict with the plugin's changes. Ensure proper handling of GraphQL tagged template literals within Vue single-file components.
To re-enable GraphQL linting, add `pluginOptions.apollo.lintGQL: true` to your `vue.config.js` file.
Ensure `vue-cli-plugin-apollo` is updated to at least v0.18.1 to mitigate potential security risks associated with older `nodemon` versions in the development server.
Update `vue-cli-plugin-apollo` to v0.22.2 or later, which includes a fix to use `getIntrospectionQuery` with `graphql@15`.
Verify that the paths specified in `vue.config.js` for schema generation or API sources exist and that the running process has appropriate read/write permissions. Ensure all relevant files are present.
Update `vue-cli-plugin-apollo` to v0.22.2 or later, which contains a fix for this specific link configuration issue.
Ensure that your `onResetStore` implementation, if used, consistently returns a `Promise`, for example, by making it an `async` function or explicitly returning `Promise.resolve()`.
Ensure all related `graphql` and `graphql-tag` dependencies are at compatible versions. This error was sometimes resolved by simply installing `vue-cli-plugin-apollo`, as it correctly configures the environment. If it persists, check your `webpack` or `babel` configuration for module resolution issues.