I want write typescript
dynamicContent?: {
data?: {
attributes?: {
baccarat?: { title?: string | null; content?: string | null } | null;
baccaratOnline?: { title?: string | null; content?: string | null } | null;
casino?: { title?: string | null; content?: string | null } | null;
casinoOnline?: { title?: string | null; content?: string | null } | null;
games?: Array<{
gameUrl?: string | null;
media: {
data?: {
attributes?: {
url: string;
alternativeText?: string | null;
width?: number | null;
height?: number | null;
} | null;
} | null;
};
} | null> | null;
} | null;
} | null;
} | null;
};
I want to use type games here is what I try
Pick<NonNullable<GetDynamicContentQuery["dynamicContent"]["data"]["attributes"]>, 'games'>
it seems like nullable only dynamicContent field am not sure how to nullable all