Add package for apollo composition API

This commit is contained in:
Ramon Wenger 2023-02-02 19:31:45 +01:00
parent a52671fd40
commit c218904c73
3 changed files with 154 additions and 2 deletions

145
client/package-lock.json generated
View File

@ -28,6 +28,7 @@
"@tiptap/vue-3": "^2.0.0-beta.90",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"@vue/apollo-composable": "^4.0.0-beta.1",
"@vue/apollo-option": "^4.0.0-alpha.16",
"@vue/compat": "3.2.30",
"@vue/compiler-sfc": "3.2.30",
@ -82,6 +83,7 @@
"ts-loader": "^8.3.0",
"typescript": "^4.5.4",
"uploadcare-widget": "^3.6.0",
"url-loader": "^4.1.1",
"vee-validate": "^4.5.10",
"vue": "3.2.30",
"vue-loader": "^16.8.3",
@ -3950,6 +3952,52 @@
"weakmap-polyfill": "2.0.4"
}
},
"node_modules/@vue/apollo-composable": {
"version": "4.0.0-beta.1",
"resolved": "https://registry.npmjs.org/@vue/apollo-composable/-/apollo-composable-4.0.0-beta.1.tgz",
"integrity": "sha512-WjyePUFYft7dZMNrO63DuP5bsl1AO1SKhfy688r2HXlyrCQAxvfRXOiPqnPzhmRn7kyWTKfrwwhkFJfnSq7vyA==",
"dependencies": {
"throttle-debounce": "^3.0.1",
"ts-essentials": "^9.1.2",
"vue-demi": "^0.13.1"
},
"peerDependencies": {
"@apollo/client": "^3.4.13",
"@vue/composition-api": "^1.0.0",
"graphql": ">=15",
"vue": "^2.6.0 || ^3.1.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
}
},
"node_modules/@vue/apollo-composable/node_modules/vue-demi": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.13.11.tgz",
"integrity": "sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==",
"hasInstallScript": true,
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1",
"vue": "^3.0.0-0 || ^2.6.0"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
}
},
"node_modules/@vue/apollo-option": {
"version": "4.0.0-alpha.20",
"resolved": "https://registry.npmjs.org/@vue/apollo-option/-/apollo-option-4.0.0-alpha.20.tgz",
@ -16407,6 +16455,14 @@
"glob": "^7.1.2"
}
},
"node_modules/ts-essentials": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-9.3.0.tgz",
"integrity": "sha512-XeiCboEyBG8UqXZtXl59bWEi4ZgOqRsogFDI6WDGIF1LmzbYiAkIwjkXN6zZWWl4re/lsOqMlYfe8KA0XiiEPw==",
"peerDependencies": {
"typescript": ">=4.1.0"
}
},
"node_modules/ts-invariant": {
"version": "0.10.3",
"resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz",
@ -16844,6 +16900,49 @@
"punycode": "^2.1.0"
}
},
"node_modules/url-loader": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/url-loader/-/url-loader-4.1.1.tgz",
"integrity": "sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==",
"dependencies": {
"loader-utils": "^2.0.0",
"mime-types": "^2.1.27",
"schema-utils": "^3.0.0"
},
"engines": {
"node": ">= 10.13.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
},
"peerDependencies": {
"file-loader": "*",
"webpack": "^4.0.0 || ^5.0.0"
},
"peerDependenciesMeta": {
"file-loader": {
"optional": true
}
}
},
"node_modules/url-loader/node_modules/schema-utils": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
"integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
"dependencies": {
"@types/json-schema": "^7.0.8",
"ajv": "^6.12.5",
"ajv-keywords": "^3.5.2"
},
"engines": {
"node": ">= 10.13.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
}
},
"node_modules/url-parse": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
@ -20917,6 +21016,24 @@
"weakmap-polyfill": "2.0.4"
}
},
"@vue/apollo-composable": {
"version": "4.0.0-beta.1",
"resolved": "https://registry.npmjs.org/@vue/apollo-composable/-/apollo-composable-4.0.0-beta.1.tgz",
"integrity": "sha512-WjyePUFYft7dZMNrO63DuP5bsl1AO1SKhfy688r2HXlyrCQAxvfRXOiPqnPzhmRn7kyWTKfrwwhkFJfnSq7vyA==",
"requires": {
"throttle-debounce": "^3.0.1",
"ts-essentials": "^9.1.2",
"vue-demi": "^0.13.1"
},
"dependencies": {
"vue-demi": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.13.11.tgz",
"integrity": "sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==",
"requires": {}
}
}
},
"@vue/apollo-option": {
"version": "4.0.0-alpha.20",
"resolved": "https://registry.npmjs.org/@vue/apollo-option/-/apollo-option-4.0.0-alpha.20.tgz",
@ -30075,6 +30192,12 @@
"glob": "^7.1.2"
}
},
"ts-essentials": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-9.3.0.tgz",
"integrity": "sha512-XeiCboEyBG8UqXZtXl59bWEi4ZgOqRsogFDI6WDGIF1LmzbYiAkIwjkXN6zZWWl4re/lsOqMlYfe8KA0XiiEPw==",
"requires": {}
},
"ts-invariant": {
"version": "0.10.3",
"resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz",
@ -30374,6 +30497,28 @@
"punycode": "^2.1.0"
}
},
"url-loader": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/url-loader/-/url-loader-4.1.1.tgz",
"integrity": "sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==",
"requires": {
"loader-utils": "^2.0.0",
"mime-types": "^2.1.27",
"schema-utils": "^3.0.0"
},
"dependencies": {
"schema-utils": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
"integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
"requires": {
"@types/json-schema": "^7.0.8",
"ajv": "^6.12.5",
"ajv-keywords": "^3.5.2"
}
}
}
},
"url-parse": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",

View File

@ -53,6 +53,7 @@
"@tiptap/vue-3": "^2.0.0-beta.90",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"@vue/apollo-composable": "^4.0.0-beta.1",
"@vue/apollo-option": "^4.0.0-alpha.16",
"@vue/compat": "3.2.30",
"@vue/compiler-sfc": "3.2.30",

View File

@ -1,5 +1,5 @@
import 'core-js/stable';
import { createApp, configureCompat } from 'vue';
import { createApp, configureCompat, h, provide } from 'vue';
import VueVimeoPlayer from 'vue-vimeo-player';
import apolloClientFactory from './graphql/client';
import App from './App.vue';
@ -15,6 +15,7 @@ import VueMatomo from 'vue-matomo';
import { createApolloProvider } from '@vue/apollo-option';
import { joiningClass, loginRequired, unauthorizedAccess } from '@/router/guards';
import flavorPlugin from '@/plugins/flavor';
import { DefaultApolloClient } from '@vue/apollo-composable';
const publicApolloClient = apolloClientFactory('/api/graphql-public/', null);
const privateApolloClient = apolloClientFactory('/api/graphql/', networkErrorCallback);
@ -30,7 +31,12 @@ configureCompat({
MODE: 2,
});
const app = createApp(App);
const app = createApp({
setup() {
provide(DefaultApolloClient, privateApolloClient);
},
render: () => h(App),
});
app.use(store);