Skip to content

Q. Can we preload multiple queries In RSC using <PreloadQuery> #498

@swaroopb2001

Description

@swaroopb2001

We have next.js web app using Apollo to fetch data and have an use case to prelaod data in our RSC for multiple queries . I see that the documentation has a section on https://github.com/apollographql/apollo-client-integrations/tree/main/packages/nextjs#preloading-data-in-rsc-for-usage-in-client-components .

According to this it takes a single query document . Is there any way we can pass multiple queries as args ?

<PreloadQuery
  query={QUERY}
  variables={{
    foo: 1,
  }}
>
  <Suspense fallback={<>loading</>}>
    <ClientChild />
  </Suspense>
</PreloadQuery>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions