fix: replace content_type_id with __typename

This commit is contained in:
Arvid Norlin
2024-02-14 11:15:52 +01:00
parent 5b3b47b568
commit 0556b509bc
4 changed files with 12 additions and 4 deletions

View File

@@ -8,7 +8,11 @@ import type { PuffBlock } from "./blocks/puff"
import type { Preamble } from "./preamble"
import type { Text } from "./blocks/text"
import type { AllRequestResponse } from "./utils/all"
import type { AsideTypenameEnum, Typename } from "./utils/typename"
import type {
AsideTypenameEnum,
Typename,
PagesTypenameEnum,
} from "./utils/typename"
import type { EmbedEnum } from "./utils/embeds"
import type { Edges } from "./utils/edges"
@@ -41,6 +45,7 @@ export type Breadcrumbs = {
}
export type BlockPage = {
__typename: PagesTypenameEnum.CurrentBlocksPage
aside: Asides[]
blocks: Blocks[]
breadcrumbs: Breadcrumbs
@@ -50,7 +55,6 @@ export type BlockPage = {
url: string
system: {
uid: string
content_type_uid: string // should this be locked down to the specific enum?
created_at: string
updated_at: string
}

View File

@@ -12,6 +12,10 @@ export enum BlocksTypenameEnum {
CurrentBlocksPageBlocksText = "CurrentBlocksPageBlocksText",
}
export enum PagesTypenameEnum {
CurrentBlocksPage = "CurrentBlocksPage",
}
export type BlocksTypename = keyof typeof BlocksTypenameEnum
export type Typename<T, K> = T & {