├── .babelrc ├── .eslintignore ├── .eslintrc.js ├── .github └── FUNDING.yml ├── .gitignore ├── .npmignore ├── README.md ├── client-addon ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── README.md ├── babel.config.js ├── package.json ├── public │ └── .gitkeep ├── src │ ├── components │ │ ├── ApolloView.vue │ │ ├── GraphqlPlayground.vue │ │ ├── SimpleGraph.vue │ │ └── widgets │ │ │ ├── EngineKeyMetrics.vue │ │ │ ├── EngineKeyMetricsErrorPercentage.vue │ │ │ ├── EngineKeyMetricsP95Time.vue │ │ │ ├── EngineKeyMetricsQueries.vue │ │ │ ├── EngineKeyMetricsQuery.vue │ │ │ ├── EngineKeyMetricsRequestRate.vue │ │ │ └── EngineKeyMetricsView.vue │ ├── main.js │ └── utils │ │ └── math.js ├── vue.config.js └── yarn.lock ├── docs ├── .vuepress │ ├── config.js │ ├── public │ │ ├── favicon.png │ │ └── screenshot.png │ └── style.styl ├── README.md └── guide │ ├── auth.md │ ├── client-state.md │ ├── configuration.md │ ├── directives.md │ ├── engine.md │ ├── env.md │ ├── express-middleware.md │ ├── index.md │ ├── injected-commands.md │ ├── manual-changes.md │ ├── mocks.md │ ├── server-prod.md │ ├── server.md │ └── webpack.md ├── generator ├── index.js └── templates │ ├── api-server │ ├── default │ │ └── apollo-server │ │ │ ├── context.js │ │ │ ├── data-sources.js │ │ │ ├── directives.js │ │ │ ├── mocks.js │ │ │ ├── resolvers.js │ │ │ ├── schema.graphql │ │ │ └── type-defs.js │ └── examples │ │ └── apollo-server │ │ ├── server.js │ │ └── utils │ │ ├── db.js │ │ └── upload.js │ └── vue-apollo │ ├── default │ ├── apollo.config.js │ └── src │ │ └── vue-apollo.js │ └── examples │ └── src │ ├── components │ └── ApolloExample.vue │ └── graphql │ ├── AddMessage.gql │ ├── FileFragment.gql │ ├── Files.gql │ ├── HelloWorld.gql │ ├── MessageAdded.gql │ ├── MessageFragment.gql │ ├── Messages.gql │ └── UploadFile.gql ├── graphql-client ├── index.js └── src │ └── index.js ├── graphql-server └── index.js ├── index.js ├── logo.png ├── operations └── engine │ └── key-metrics │ ├── error-percentage.js │ ├── p95-time.js │ └── request-rate.js ├── package.json ├── prompts.js ├── screenshot.png ├── types.d.ts ├── ui-public ├── apollo-engine.png ├── publish-task.png ├── view-tip.png └── vue-apollo-graphql.png ├── ui ├── configs.js ├── index.js ├── tasks.js ├── views.js └── widgets.js ├── utils ├── check-schema.js ├── engine-api.js ├── generate-schema.js ├── index.js ├── load-env.js ├── load.js └── publish-schema.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["@babel/preset-env", { 4 | "modules": "commonjs" 5 | }] 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | templates/ 3 | dist/ 4 | client-addon/ 5 | client-addon-dist/ 6 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // Use only this configuration 3 | root: true, 4 | // File parser 5 | parser: 'vue-eslint-parser', 6 | parserOptions: { 7 | // Use babel-eslint for JavaScript 8 | parser: 'babel-eslint', 9 | ecmaVersion: 2017, 10 | // With import/export syntax 11 | sourceType: 'module', 12 | }, 13 | // Environment global objects 14 | env: { 15 | browser: true, 16 | es6: true, 17 | jest: true, 18 | }, 19 | extends: [ 20 | // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style 21 | 'standard', 22 | // https://github.com/vuejs/eslint-plugin-vue#priority-c-recommended-minimizing-arbitrary-choices-and-cognitive-overhead 23 | 'plugin:vue/recommended', 24 | ], 25 | rules: { 26 | 'comma-dangle': ['error', 'always-multiline'], 27 | 28 | // Vue 29 | 30 | // Error 31 | 'vue/html-closing-bracket-newline': ['error', { 32 | singleline: 'never', 33 | multiline: 'always', 34 | }], 35 | 'vue/html-closing-bracket-spacing': ['error', { 36 | startTag: 'never', 37 | endTag: 'never', 38 | selfClosingTag: 'never', 39 | }], 40 | 'vue/max-attributes-per-line': ['error', { 41 | singleline: 2, 42 | multiline: { 43 | max: 1, 44 | allowFirstLine: false, 45 | }, 46 | }], 47 | // Warn 48 | 'vue/require-default-prop': 'warn', 49 | 'vue/require-prop-types': 'warn', 50 | }, 51 | } 52 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: Akryum 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | client-addon-dist/ 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | client-addon/ 3 | .babelrc 4 | .eslintignore 5 | .eslintrc.js 6 | yarn.lock 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-cli-plugin-apollo 2 | 3 | [![npm](https://img.shields.io/npm/v/vue-cli-plugin-apollo.svg) ![npm](https://img.shields.io/npm/dm/vue-cli-plugin-apollo.svg)](https://www.npmjs.com/package/vue-cli-plugin-apollo) 4 | [![vue-cli3](https://img.shields.io/badge/vue--cli-3.x-brightgreen.svg)](https://github.com/vuejs/vue-cli) 5 | [![apollo-2](https://img.shields.io/badge/apollo-2.x-blue.svg)](https://www.apollographql.com/) 6 | 7 | **:rocket: Start building a Vue app with Apollo and GraphQL in 2 minutes!** 8 | 9 | This is a vue-cli 3.x plugin to add Apollo and GraphQL in your Vue project. 10 | 11 |

12 | 13 | Become a Patreon 14 | 15 |

16 | 17 |
18 | 19 |

Documentation

20 | 21 |
22 | 23 | ## Sponsors 24 | 25 | [![sponsors logos](https://guillaume-chau.info/sponsors.png)](https://guillaume-chau.info/sponsors) 26 | 27 |
28 | 29 | ![screenshot](./screenshot.png) 30 | 31 |
32 | 33 | ## :star: Features 34 | 35 | - Automatically integrate [vue-apollo](https://github.com/Akryum/vue-apollo) into your Vue app 36 | - Embed Apollo client config (upgradable and customizable) 37 | - Websockets 38 | - File uploads 39 | - Client state with [apollo-link-state](https://github.com/apollographql/apollo-link-state) 40 | - Included optional Graphql Server (upgradable and customizable): 41 | - Dead simple GraphQL API sources generated into your project (with import/export support) 42 | - Upgradable service running [apollo-server](https://www.apollographql.com/docs/apollo-server/) 43 | - Websocket subscriptions support 44 | - Optional automatic mocking 45 | - [Apollo Engine](https://www.apollographql.com/engine) support 46 | - GraphQL playground integrated in the CLI UI 47 | - Configuration screen in the CLI UI 48 | - Server-Side Rendering with [@akryum/vue-cli-plugin-ssr](https://github.com/Akryum/vue-cli-plugin-ssr) 49 | - Included optional example component with: 50 | - Watched query 51 | - Mutation 52 | - Realtime subscription using Websockets 53 | - Fully working image gallery with image upload 54 | - GraphQL validation using ESLint 55 | -------------------------------------------------------------------------------- /client-addon/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | '@vue/standard', 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'warning' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 13 | 'comma-dangle': ['error', 'always-multiline'], 14 | }, 15 | parserOptions: { 16 | parser: 'babel-eslint', 17 | }, 18 | globals: { 19 | 'ClientAddonApi': false, 20 | 'mapSharedData': false, 21 | 'Vue': false, 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /client-addon/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /client-addon/.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {}, 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /client-addon/README.md: -------------------------------------------------------------------------------- 1 | # Client addon for vue-apollo cli plugin 2 | 3 | ``` 4 | yarn serve 5 | yarn build 6 | ``` 7 | -------------------------------------------------------------------------------- /client-addon/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset', 4 | ], 5 | } 6 | -------------------------------------------------------------------------------- /client-addon/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client-addon", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "@vue/cli-ui": "^3.0.0", 12 | "@vue/ui": "^0.5.6", 13 | "core-js": "^3.1.2", 14 | "d3": "^5.7.0", 15 | "vue": "^2.5.16" 16 | }, 17 | "devDependencies": { 18 | "@vue/cli-plugin-babel": "^4.0.4", 19 | "@vue/cli-plugin-eslint": "^4.0.4", 20 | "@vue/cli-service": "^4.0.4", 21 | "@vue/cli-ui": "^3.0.0", 22 | "@vue/eslint-config-standard": "^4.0.0", 23 | "eslint": "^4.19.1", 24 | "eslint-plugin-vue": "^5.2.3", 25 | "stylus": "^0.54.5", 26 | "stylus-loader": "^3.0.2", 27 | "vue-template-compiler": "^2.5.16" 28 | }, 29 | "browserslist": [ 30 | "> 1%", 31 | "last 2 versions" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /client-addon/public/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akryum/vue-cli-plugin-apollo/d9fe48c61cc19db88fef4e4aa5e49b31aa0c44b7/client-addon/public/.gitkeep -------------------------------------------------------------------------------- /client-addon/src/components/ApolloView.vue: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /client-addon/src/components/GraphqlPlayground.vue: -------------------------------------------------------------------------------- 1 |