import App from 'next/app' import client from '../lib/apollo' import { ApolloProvider } from '@apollo/client' import Page from '../components/page' /** * Next.js uses the `App` component to initialize pages. See: * https://github.com/zeit/next.js/#custom-app * * Using next-with-apollo: * https://github.com/lfades/next-with-apollo * - Wrapping MyApp in withApollo HOC */ class MyApp extends App { static async getInitialProps ({ Component, ctx }) { let pageProps = {} if (Component.getInitialProps) { pageProps = await Component.getInitialProps(ctx) } // Add the query object to the pageProps // https://github.com/wesbos/Advanced-React/blob/master/finished-application/frontend/pages/_app.js pageProps.query = ctx.query return { pageProps } } render () { const { Component, pageProps } = this.props return ( ) } } export default MyApp