Here is some TypeScript code that I am working with:
export interface SelectQuery_thing {
__typename: "ThingQueryPayload";
content: (SelectQuery_thing_content | null)[];
pageInfo: SelectQuery_thing_pageInfo;
}
export interface SelectQuery_thing_content {
__typename: "Thing";
id: string;
name: string;
}
I am trying to access the 'name' property within a function:
const itemToString = (data: SelectQuery_thing) => data && data.content && data.name
However, I am encountering an error:
Property 'name' does not exist on type 'SelectQuery_thing_content[]'
How can I successfully access the 'name' property in this scenario?