Skip to content

Commit d4ec064

Browse files
committed
dev-check
1 parent 333540e commit d4ec064

3 files changed

Lines changed: 33 additions & 3 deletions

File tree

website/src/graphql/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const maybeDevExchange =
8888
* @param exchanges - extra exchanges the caller needs (ie. a specific client/server SSR exchange)
8989
* @returns
9090
*/
91+
console.log("GRAPHQL_URL_READ:", GRAPHQL_URL_READ)
9192
const customClient = (serverSide: boolean, exchanges: Exchange[]) =>
9293
createClient({
9394
url: GRAPHQL_URL_READ, // the auth link will move this to the write endpoint if needed
@@ -96,11 +97,11 @@ const customClient = (serverSide: boolean, exchanges: Exchange[]) =>
9697
sharedCache,
9798
...exchanges,
9899
// only the client needs the auth link
99-
...(serverSide ? [] : [cognitoAuthExchange()]),
100+
//...(serverSide ? [] : [cognitoAuthExchange()]),
100101
fetchExchange,
101102
],
102-
suspense: serverSide,
103-
fetch, // TODO: is this needed?
103+
//suspense: serverSide,
104+
suspense: false,
104105
})
105106

106107
/**

website/src/pages/documents/document-info.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ export type TabSegment = Dailp.DocumentMetadataUpdate | Document
2323
export type Document = NonNullable<Dailp.AnnotatedDocumentQuery["document"]>
2424

2525
export const DocumentInfo = ({ doc }: { doc: Document }) => {
26+
const isBrowser = typeof window !== "undefined"
27+
2628
const [{ data }, reexecuteQuery] = Dailp.useDocumentDetailsQuery({
29+
pause: !isBrowser,
2730
variables: { slug: doc.slug! },
2831
})
2932
const token = useCredentials()

website/src/pages/index.page.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,37 @@ import { DailpPageContents } from "./dailp.page"
2020

2121
/** Lists all documents in our database */
2222
const IndexPage = () => {
23+
console.log("INDEX PAGE RENDERED")
2324
const [{ data: dailp }] = Dailp.useEditedCollectionsQuery()
25+
const dailpQuery = Dailp.useEditedCollectionsQuery()
26+
console.log("DAILP FULL QUERY:", dailpQuery)
27+
28+
const pagesQuery = Dailp.useAllPagesQuery()
29+
console.log("PAGES FULL QUERY:", pagesQuery)
30+
31+
console.log("Raw DAILP response:", dailp)
32+
33+
dailp?.allEditedCollections?.forEach((c) => {
34+
if (
35+
c.thumbnailUrl?.includes("https//") ||
36+
c.thumbnailUrl?.includes("https://https//")
37+
) {
38+
console.error("MALFORMED THUMBNAIL URL:", c.slug, c.thumbnailUrl)
39+
}
40+
})
41+
2442
const userRole = useUserRole()
2543

2644
const [{ data }] = Dailp.useAllPagesQuery()
2745

46+
console.log("Raw pages response:", data)
47+
48+
data?.allPages?.forEach((p) => {
49+
if (p.path?.includes("https//")) {
50+
console.error("MALFORMED PAGE URL:", p.path)
51+
}
52+
})
53+
2854
// Fetch stories
2955
const stories = data?.allPages?.filter(
3056
(p) => p.path?.includes("/stories/") || p.path?.includes("/spotlights/")

0 commit comments

Comments
 (0)