I get a TypeScript type autogenerated from AWS-Amplify GraphQL (which uses apollo-codegen I believe) like such:
export type GetNoteQuery = {
getNote: {
__typename: "Note",
id: string,
createdAt: string | null,
updatedAt: string | null,
title: boolean | null,
content: string | null,
} | null,
I want to generate a base type of "Note" to use as "base" type to use in my code when using the returned data. I.e. mapping notes onto a React component, etc.
Is there a way to narrow this type that is auto generated, or to extend it in some way, to have it look like:
type Note = {
id: string,
createdAt: string | null,
updatedAt: string | null,
title: boolean | null,
content: string | null
}