diff --git a/src/lib/gql/gql-client.tsx b/src/lib/gql/gql-client.tsx index 09ea25cc..cc52168e 100644 --- a/src/lib/gql/gql-client.tsx +++ b/src/lib/gql/gql-client.tsx @@ -16,9 +16,7 @@ export const graphqlClient = (requestConfig: Omit = {}, i export const buildHeaders = (headers?: HeadersInit, isPreviewMode?: boolean): Headers => { const requestHeaders = new Headers(headers) // If viewing while in preview mode, use the admin credentials if they are available. Fall back to the basic credentials. - const authCreds = ( - isPreviewMode ? process.env.DRUPAL_BASIC_AUTH_ADMIN || process.env.DRUPAL_BASIC_AUTH : process.env.DRUPAL_BASIC_AUTH - ) as string + const authCreds = (isPreviewMode ? process.env.DRUPAL_BASIC_AUTH : process.env.DRUPAL_BASIC_AUTH) as string requestHeaders.set("Authorization", "Basic " + Buffer.from(authCreds).toString("base64")) return requestHeaders diff --git a/src/lib/gql/gql-queries.tsx b/src/lib/gql/gql-queries.tsx index ebcb8be0..23d3fed5 100644 --- a/src/lib/gql/gql-queries.tsx +++ b/src/lib/gql/gql-queries.tsx @@ -63,7 +63,7 @@ export const getConfigPage = async ( async () => { let query: ConfigPagesQuery try { - query = await graphqlClient({next: {tags: ["config-pages"]}}).ConfigPages() + query = await graphqlClient({cache: "no-cache"}).ConfigPages() } catch (e) { console.warn("Unable to fetch config pages: " + (e instanceof Error && e.stack)) return @@ -104,7 +104,7 @@ export const getMenu = cache(async (name?: MenuAvailable, maxLevels?: number): P const getData = nextCache( async () => { - const menu = await graphqlClient({next: {tags: [`menu:${menuName}`]}}).Menu({name}) + const menu = await graphqlClient({cache: "no-cache"}).Menu({name}) const menuItems = (menu.menu?.items || []) as MenuItem[] const filterInaccessible = (items: MenuItem[], level: number): MenuItem[] => { @@ -133,7 +133,7 @@ export const getAllNodes = nextCache( const cursors: Omit = {} while (fetchMore) { - nodeQuery = await graphqlClient({next: {tags: ["paths"]}}).AllNodes({first: 1000, ...cursors}) + nodeQuery = await graphqlClient({cache: "no-cache"}).AllNodes({first: 1000, ...cursors}) queryKeys = Object.keys(nodeQuery) as (keyof AllNodesQuery)[] fetchMore = false