import { getServerSideSitemap } from 'next-sitemap' ; import { GetServerSideProps } from 'next' ; import client from 'graphql/client' ; import { GetPlacesQuery } from 'graphql/generated/graphql' ; import { GET_PLACES } from 'graphql/queries' ; export const getServerSideProps = async ( ctx ) => { const { places } = await client . request < GetPlacesQuery > ( GET_PLACES ) ; const fields = places . map ( ( { slug } ) => ( { loc : `https://my-trips.willianjusten.com.br/place/${ slug }` , lastmod : new Date ( ) . toISOString ( ) } ) ) ; fields . push ( { loc : 'https://my-trips.willianjusten.com.br' , lastmod : new Date ( ) . toISOString ( ) } , { loc : 'https://my-trips.willianjusten.com.br/about' , lastmod : new Date ( ) . toISOString ( ) } ) ; return getServerSideSitemap ( ctx , fields ) ; } ; export default ( ) => { } ;