diff --git a/lib/api/client/query.ts b/lib/api/client/query.ts index a48e184a..f92f032e 100644 --- a/lib/api/client/query.ts +++ b/lib/api/client/query.ts @@ -28,13 +28,18 @@ const queryAPI = async ({ fetchOptions?: RequestInit; previewToken?: string; }): Promise> => { - const defaultFetchOptions = { + const defaultFetchOptions: RequestInit = { cache: "force-cache", next: { revalidate: previewToken ? 0 : undefined, }, }; const fetchOptions = merge({}, defaultFetchOptions, inputFetchOptions); + + if (inputFetchOptions?.next?.revalidate) { + delete fetchOptions.cache; + } + const params = new URLSearchParams({}); if (previewToken) { diff --git a/lib/api/globals/index.ts b/lib/api/globals/index.ts index d091f5c3..07ed642c 100644 --- a/lib/api/globals/index.ts +++ b/lib/api/globals/index.ts @@ -21,14 +21,14 @@ export async function getLogos() { ... on siteInfo_GlobalSet { logoLarge { url { - directUrlPreview + directUrlOriginal } width height } logoSmall { url { - directUrlPreview + directUrlOriginal } width height @@ -41,7 +41,9 @@ export async function getLogos() { const { data } = await queryAPI({ query, variables: { set: "siteInfo" }, - fetchOptions: { next: { tags: [tags.globals], revalidate: 60 * 60 } }, + fetchOptions: { + next: { tags: [tags.globals], revalidate: 60 * 60 }, + }, }); if (!data || !data.siteInfo) { @@ -53,15 +55,17 @@ export async function getLogos() { } = data; const { props: large } = getImageProps({ - ...cantoToImageProps(logoLarge[0], { usePreviewUrl: true }), + ...cantoToImageProps(logoLarge[0]), priority: true, + sizes: "33vw", quality: 90, }); if (logoSmall[0]) { const { props: small } = getImageProps({ - ...cantoToImageProps(logoSmall[0], { usePreviewUrl: true }), + ...cantoToImageProps(logoSmall[0]), priority: true, + sizes: "100vw", quality: 90, });