import { graphql } from 'gatsby';
const Footer = ({phone}: { phone?: Queries.FooterFragment['phone'];}): JSX.Element => {
return <footer>{phone}</footer>;
};
export default Footer
export const query = graphql`
fragment Footer on ContentfulBlockFooter {
id
name
phone
}`;
This code snippet is a part of a Gatsby project that utilizes TypeScript and GraphQL Typegen. It demonstrates how to import a single value from a Fragment. Is there a more efficient way to destructure my Queries object to include id, name, and phone as component props without explicitly typing each one?
phone?: Queries.FooterFragment['phone'],
name?: Queries.FooterFragment['name'],
id?: Queries.FooterFragment['id]