refactor: update to nuxt-graphql 0.5.x
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { BuilderSectionsFragment } from "#graphql/typed-documents";
|
||||
import type { BuilderSectionsFragment } from "#graphql/fragments";
|
||||
|
||||
const props = defineProps<BuilderSectionsFragment>();
|
||||
const sections = computed(() => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { LayoutContainedFragment } from "#graphql/typed-documents";
|
||||
import type { LayoutContainedFragment } from "#graphql/fragments";
|
||||
import { tv, type VariantProps } from "tailwind-variants";
|
||||
|
||||
const props = defineProps<LayoutContainedFragment>();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { NodePageFragment } from "#graphql/typed-documents";
|
||||
import type { NodePageFragment } from "#graphql/fragments";
|
||||
|
||||
defineProps<NodePageFragment>();
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SectionTextBlockFragment } from "#graphql/typed-documents";
|
||||
import type { SectionTextBlockFragment } from "#graphql/fragments";
|
||||
|
||||
defineProps<SectionTextBlockFragment>();
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
const { data } = await useGraphQLQuery("GeneralSettings", undefined, { cache: { ttl: 0 } });
|
||||
const { data } = await useAsyncGraphQLQuery("GeneralSettings", undefined, { cache: { ttl: 0 } });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -28,7 +28,7 @@ export function useAuthConnexion() {
|
||||
async function login({ data: variables }: FormSubmitEvent<AuthLoginForm>, redirect?: string) {
|
||||
try {
|
||||
const { data } = await loginMutate(variables);
|
||||
if (!data.login) {
|
||||
if (!data?.login) {
|
||||
throw new Error(`Échec de la connexion par mot de passe.`);
|
||||
}
|
||||
await redirectTo(redirect);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
const { path: uri } = useRoute();
|
||||
const { data } = await useGraphQLQuery("NodeByUri", { uri });
|
||||
const { data } = await useAsyncGraphQLQuery("NodeByUri", { uri });
|
||||
|
||||
// Resolve and validate Node component
|
||||
if (!data.value.nodeByUri) {
|
||||
|
||||
Reference in New Issue
Block a user