import { graphql } from './gql'; import { FragmentType, useFragment } from './gql/fragment-masking'; export const FilmFragment = graphql(/* GraphQL */ ` fragment FilmItem on Film { id title releaseDate producers } `); const Film = (props: { /* tweet property has the correct type 🎉 */ film: FragmentType; }) => { const film = useFragment(FilmFragment, props.film); return (

{film.title}

{film.releaseDate}

); }; export default Film;