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

View File

@@ -0,0 +1,4 @@
export type AllRequestResponse<T> = {
items: T[]
total: number
}

View File

@@ -0,0 +1,8 @@
import type { Typename } from "./typename"
export type Asset = {
title: string
url: string
}
export type SysAsset = Typename<Asset, "SysAsset">

View File

@@ -0,0 +1,8 @@
export type Node<T> = {
node: T
}
export type Edges<T> = {
edges: Node<T>[]
totalCount: number
}

View File

@@ -0,0 +1,5 @@
export type ExternalLink = {
__typename: "TempPage"
title: string
url: string
}

View File

@@ -0,0 +1,5 @@
export type PageLink = {
__typename: "CurrentBlocksPage"
title: string
url: string
}

View File

@@ -0,0 +1,31 @@
export const AsideTypenames = {
CurrentBlocksPageAsideContact: "CurrentBlocksPageAsideContact",
CurrentBlocksPageAsidePuff: "CurrentBlocksPageAsidePuff",
}
export enum AsideTypenameEnum {
CurrentBlocksPageAsideContact = "CurrentBlocksPageAsideContact",
CurrentBlocksPageAsidePuff = "CurrentBlocksPageAsidePuff",
}
export type AsideTypename = keyof typeof AsideTypenameEnum
export const blocksTypenameEnum = {
CurrentBlocksPageBlocksList: "CurrentBlocksPageBlocksList",
CurrentBlocksPageBlocksPreamble: "CurrentBlocksPageBlocksPreamble",
CurrentBlocksPageBlocksPuffs: "CurrentBlocksPageBlocksPuffs",
CurrentBlocksPageBlocksText: "CurrentBlocksPageBlocksText",
}
export type BlocksTypename = keyof typeof blocksTypenameEnum
export enum BlocksTypenameEnum {
CurrentBlocksPageBlocksList = "CurrentBlocksPageBlocksList",
CurrentBlocksPageBlocksPreamble = "CurrentBlocksPageBlocksPreamble",
CurrentBlocksPageBlocksPuffs = "CurrentBlocksPageBlocksPuffs",
CurrentBlocksPageBlocksText = "CurrentBlocksPageBlocksText",
}
export type Typename<T, K> = T & {
__typename: K
}