Skip to content

Chained queries for component #3489

@joriswijlens

Description

@joriswijlens

We have a use case where it is not really clear (legacy) whether a url is for a category page or a product page, so first we want to call the url mapping endpoint and then render the list or detail page based on the resource type and id.

We wanted to solve this by getting the url mapping in getProps. Assuming that the getProps would execute before the component.

This seems not to be the case, withReactQuery runs in parallel with withLegacyGetProps. This causes the useProduct hook to execute on the client only and SEO would be hurt.

Solving it in the component also does not work because react-ssr-prepass only does one pass. Understandable, because I can imagine extra passes would not be very performant!?

What I do not understand is, why getProps does not offer me a way to do something before react-query to solve this challenge.

Am I missing something?

We are using PWA kit: 3.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions