WP ACF Flex Fields in Graphql with Apollo

Hi, I am trying to use ACF pro flex fields with graphql in a headless wp project. How do I handle the “… on” in the below query when I want to display the “mainHeading” field? I have this as props “page: data.page.homePageSettings.content” but “

{page.mainHeading}

” doesn’t do the trick.

query homeMainHeading {
page(id: “cG9zdDo5”) {
homePageSettings {
content {
… on Page_Homepagesettings_Content_HeroSection {
mainHeading
}
}
}
}
}