From 17c80e07f3617a34ef1982332e3dd8e51026d6fd Mon Sep 17 00:00:00 2001 From: Hangzhi Yu <hangzhi@protonmail.com> Date: Tue, 20 Dec 2022 18:36:41 +0100 Subject: [PATCH] Use require to import graphql files when using vue apollo components --- aleksis/core/assets/components/SidenavSearch.vue | 4 +--- aleksis/core/assets/components/about/InstalledAppsList.vue | 3 +-- .../core/assets/components/notifications/NotificationItem.vue | 4 +--- .../core/assets/components/notifications/NotificationList.vue | 3 +-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/aleksis/core/assets/components/SidenavSearch.vue b/aleksis/core/assets/components/SidenavSearch.vue index ea044a9b6..58bf7bf6d 100644 --- a/aleksis/core/assets/components/SidenavSearch.vue +++ b/aleksis/core/assets/components/SidenavSearch.vue @@ -1,6 +1,4 @@ <script> -import gqlSearchSnippets from "./searchSnippets.graphql"; - export default { methods: { submit: function () { @@ -24,7 +22,7 @@ export default { <template> <ApolloQuery - :query="gqlSearchSnippets" + :query="require('./searchSnippets.graphql')" :variables="{ q, }" diff --git a/aleksis/core/assets/components/about/InstalledAppsList.vue b/aleksis/core/assets/components/about/InstalledAppsList.vue index 704eedc97..491e3df15 100644 --- a/aleksis/core/assets/components/about/InstalledAppsList.vue +++ b/aleksis/core/assets/components/about/InstalledAppsList.vue @@ -1,5 +1,5 @@ <template> - <ApolloQuery :query="gqlInstalledApps"> + <ApolloQuery :query="require('./installedApps.graphql')"> <template #default="{ result: { error, data }, isLoading }"> <v-row v-if="isLoading"> <v-col @@ -31,7 +31,6 @@ <script> import InstalledAppCard from "./InstalledAppCard.vue"; -import gqlInstalledApps from "./installedApps.graphql"; export default { name: "InstalledAppsList", diff --git a/aleksis/core/assets/components/notifications/NotificationItem.vue b/aleksis/core/assets/components/notifications/NotificationItem.vue index 6011765af..b1dea65c1 100644 --- a/aleksis/core/assets/components/notifications/NotificationItem.vue +++ b/aleksis/core/assets/components/notifications/NotificationItem.vue @@ -1,6 +1,6 @@ <template> <ApolloMutation - :mutation="gqlmarkNotificationRead" + :mutation="require('./markNotificationRead.graphql')" :variables="{ id: this.notification.id }" > <template #default="{ mutate, loading, error }"> @@ -80,8 +80,6 @@ </template> <script> -import gqlMarkNotificationRead from "./markNotificationRead.graphql"; - export default { props: { notification: { diff --git a/aleksis/core/assets/components/notifications/NotificationList.vue b/aleksis/core/assets/components/notifications/NotificationList.vue index b0e4a50a0..75493f837 100644 --- a/aleksis/core/assets/components/notifications/NotificationList.vue +++ b/aleksis/core/assets/components/notifications/NotificationList.vue @@ -1,6 +1,6 @@ <template> <ApolloQuery - :query="gqlMyNotifications" + :query="require('./myNotifications.graphql')" :poll-interval="1000" > <template #default="{ result: { error, data, loading } }"> @@ -74,7 +74,6 @@ <script> import NotificationItem from "./NotificationItem.vue"; -import gqlMyNotifications from "./myNotifications.graphql"; export default { components: { -- GitLab