Fix a mutation that should have been a query

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-06-28 09:36:29 +02:00
parent b2a40d15fa
commit 98b8b3338c
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
2 changed files with 4 additions and 4 deletions

View File

@ -158,7 +158,7 @@ export const PRIVACY = gql`
`;
export const TIMEZONES = gql`
query {
query Timezones {
config {
timezones
}
@ -166,7 +166,7 @@ export const TIMEZONES = gql`
`;
export const WEB_PUSH = gql`
query {
query WebPush {
config {
webPush {
enabled

View File

@ -22,8 +22,8 @@ export async function subscribeUserToPush(): Promise<PushSubscription | null> {
apolloProvider.defaultClient as ApolloClient<NormalizedCacheObject>;
const registration = await navigator.serviceWorker.ready;
const { data } = await client.mutate<{ config: IConfig }>({
mutation: WEB_PUSH,
const { data } = await client.query<{ config: IConfig }>({
query: WEB_PUSH,
});
if (data?.config?.webPush?.enabled && data?.config?.webPush?.publicKey) {