reactjs – Wrap Gatsby pages query props

Looking to reproduce the code below that passes the query into the Gatsby page as props. Experimented with gatsby-browser but no success.

import { graphql, useStaticQuery } from 'gatsby'

import AboutPage from '@views/about/AboutPage'

export const query = useStaticQuery(graphql`
  query AboutPage {
    allPagesJson(filter: {name: {eq: "about"}}) {
      edges {
        node {
          title
          description
          meta_description
          meta_title
        }
      }
    }
  }
`);

AboutPage.query = query
AboutPage.fragments = ()

export default AboutPage