Add vue-apollo to user-app

It does not fetch anything yet.
It points to the graphql server on localhost, which is a hardcoded dev-mode.
Added config for GraphQL JS intellij plugin which inspects a "remote" graphql schema for better type hints in graphql queries in code
This commit is contained in:
Christoph Lienhard 2020-06-14 03:00:19 +02:00
parent 06a9fdf107
commit 13be951160
5 changed files with 682 additions and 203 deletions

3
.gitignore vendored
View File

@ -23,3 +23,6 @@ yarn-error.log*
*.njsproj *.njsproj
*.sln *.sln
*.sw* *.sw*
# GraphQl plugin related
./postgraphile-schema.graphql

15
.graphqlconfig Normal file
View File

@ -0,0 +1,15 @@
{
"name": "Postgraphile Schema",
"schemaPath": "postgraphile-schema.graphql",
"extensions": {
"endpoints": {
"Remote SWAPI GraphQL Endpoint": {
"url": "http://localhost:5433/graphql",
"headers": {
"user-agent": "JS GraphQL"
},
"introspect": true
}
}
}
}

849
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,9 @@
"admin": "node bin/admin-yml" "admin": "node bin/admin-yml"
}, },
"dependencies": { "dependencies": {
"apollo-boost": "^0.4.9",
"graphql": "^15.1.0",
"graphql-tag": "^2.10.3",
"lint-staged": "^8.1.5", "lint-staged": "^8.1.5",
"register-service-worker": "^1.6.2", "register-service-worker": "^1.6.2",
"stylelint": "^10.0.0", "stylelint": "^10.0.0",
@ -18,6 +21,7 @@
"stylelint-processor-html": "^1.0.0", "stylelint-processor-html": "^1.0.0",
"stylelint-webpack-plugin": "^0.10.5", "stylelint-webpack-plugin": "^0.10.5",
"vue": "^2.6.6", "vue": "^2.6.6",
"vue-apollo": "^3.0.3",
"vue-feather-icons": "^4.10.0", "vue-feather-icons": "^4.10.0",
"vue-i18n": "^8.10.0", "vue-i18n": "^8.10.0",
"vue-markdown": "^2.2.4", "vue-markdown": "^2.2.4",
@ -41,7 +45,7 @@
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"husky": "^1.3.1", "husky": "^1.3.1",
"js-yaml": "^3.13.1", "js-yaml": "^3.13.1",
"node-sass": "^4.13.1", "node-sass": "^4.14.1",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"ora": "^3.4.0", "ora": "^3.4.0",
"sass-loader": "^7.2.0", "sass-loader": "^7.2.0",

View File

@ -8,14 +8,26 @@ import storage from '@/helper/storage'
import '@/registerComponents' import '@/registerComponents'
import '@/registerServiceWorker' import '@/registerServiceWorker'
import VueApollo from 'vue-apollo'
import ApolloClient from 'apollo-boost'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(VueSVGIcon) Vue.use(VueSVGIcon)
Vue.use(storage) Vue.use(storage)
Vue.use(VueApollo)
const apolloClient = new ApolloClient({
uri: 'http://localhost:5433/graphql'
})
const apolloProvider = new VueApollo({
defaultClient: apolloClient
})
new Vue({ new Vue({
i18n, i18n,
router, router,
apolloProvider,
data: { data: {
backupStorage: { backupStorage: {
answers: undefined, answers: undefined,