fix: significantly reduce unnecessary GraphQL HTTP calls for config information

Also stops calling the heavy ABOUT GraphQL query on HomeView, which does not require the longDescription field.

Fixes #1598
This commit is contained in:
Massedil
2025-06-20 23:58:41 +02:00
parent 1c467099f0
commit 7ceb631518
14 changed files with 69 additions and 369 deletions

View File

@@ -1,6 +1,6 @@
import { apolloClient } from "@/vue-apollo";
import { provideApolloClient, useQuery } from "@vue/apollo-composable";
import { WEB_PUSH } from "../graphql/config";
import { CONFIG } from "../graphql/config";
import { IConfig } from "../types/config.model";
function urlBase64ToUint8Array(base64String: string): Uint8Array {
@@ -18,7 +18,7 @@ function urlBase64ToUint8Array(base64String: string): Uint8Array {
export async function subscribeUserToPush(): Promise<PushSubscription | null> {
const { onResult } = provideApolloClient(apolloClient)(() =>
useQuery<{ config: IConfig }>(WEB_PUSH)
useQuery<{ config: IConfig }>(CONFIG)
);
return new Promise((resolve, reject) => {