feat: graphql client with fetches for initial pages

This commit is contained in:
Simon Emanuelsson
2024-02-01 16:19:16 +01:00
parent a91781137a
commit 5e974aa3da
56 changed files with 2580 additions and 1512 deletions
+46
View File
@@ -0,0 +1,46 @@
import type { Edges } from "../utils/edges"
import type { ExternalLink } from "../utils/externalLink"
import type { PageLink } from "../utils/pagelink"
enum ListItemStyleEnum {
checkmark = "checkmark",
default = "default",
}
type ListItemStyle = keyof typeof ListItemStyleEnum
type ExternalLinkListItem = {
list_item_external_link: {
link: {
href: string
title: string
}
list_item_style: ListItemStyle
subtitle?: string
}
}
type InternalLinkListItem = {
list_item_internal_link: {
link_text?: string
list_item_style: ListItemStyle
subtitle?: string
pageConnection: Edges<ExternalLink | PageLink>
}
}
type RegularListItem = {
list_item: {
list_item_style: ListItemStyle
subtitle?: string
title: string
}
}
type ListItem = ExternalLinkListItem | InternalLinkListItem | RegularListItem
export type List = {
list: {
list_items: ListItem
}
}
+17
View File
@@ -0,0 +1,17 @@
import type { SysAsset } from "../utils/asset"
import type { Edges } from "../utils/edges"
import type { ExternalLink } from "../utils/externalLink"
import type { PageLink } from "../utils/pagelink"
export type Preamble = {
preamble: {
text: {
json: JSON
embedded_itemsConnection: Edges<
| ExternalLink
| PageLink
| SysAsset
>
}
}
}
+8
View File
@@ -0,0 +1,8 @@
import type { Edges } from "../utils/edges"
import type { Puff } from "../puff"
export type PuffBlock = {
puffs: {
puffsConnection: Edges<Puff>
}
}
+19
View File
@@ -0,0 +1,19 @@
import type { RTERootObject } from "@/types/rte"
import type { SysAsset } from "../utils/asset"
import type { Edges } from "../utils/edges"
import type { ExternalLink } from "../utils/externalLink"
import type { PageLink } from "../utils/pagelink"
export type Text = {
text: {
content: {
json: RTERootObject
embedded_itemsConnection: Edges<
| ExternalLink
| PageLink
| SysAsset
>
}
}
}