import {apolloClient} from 'graphql/apolloClient'; import {GET_PRODUCTS} from 'graphql/queries/getProducts'; import {GetStaticProps} from 'next'; export const getStaticProps: GetStaticProps = async () => { const {data} = await apolloClient.query({ query: GET_PRODUCTS, variables: {first: 10}, }); return { props: { products: data.products.edges.map((e: any) => e.node), }, revalidate: 300, }; } export default function Home({products}: { products: any[] }) { return (