Skip to content

Improve with-apollo example to more closely align to Next.js standards #21984

@leerob

Description

@leerob

What example does this report relate to?

with-apollo

What version of Next.js are you using?

latest

What version of Node.js are you using?

latest

What browser are you using?

any

What operating system are you using?

any

How are you deploying your application?

any

Describe the Bug

The current with-apollo example fetches data and adds it to the cache, but never returns that data inside getStaticPaths / getSeverSideProps.

await apolloClient.query({
  query: ALL_POSTS_QUERY,
  variables: allPostsQueryVars
})

Expected Behavior

All other usage of getStaticProps / getServerSideProps show forwarded the data to the component via props (hence the names). This seems really confusing to me. I think we should use props here instead.

To Reproduce

View the with-apollo example

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.examplesIssue was opened via the examples template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions