You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So when i call my query via a suspense i would expect the fallback to show then the data to load and be displayed but what i get is.
The data displayed, a flash of the fallback then data displayed again.
here is my code.
function makeClient() {
const httpLink = new HttpLink({
uri: process.env.NEXT_PUBLIC_GRAPHQL_API,
fetchOptions: { cache: "no-store" },
});
// Use the `ApolloClient` from "@apollo/experimental-nextjs-app-support"
return new ApolloClient({
// Use the `InMemoryCache` from "@apollo/experimental-nextjs-app-support"
cache: new InMemoryCache({ resultCaching: false }),
link: from([new RetryLink(), errorLink, authLink, httpLink]),
});
}
// You need to create a component to wrap your app in
function ApolloWrapper({ children }: PropsWithChildren) {
return (
<ApolloNextAppProvider makeClient={makeClient}>
{children}
</ApolloNextAppProvider>
);
}
import { HttpLink } from "@apollo/client";
import {
ApolloClient,
InMemoryCache,
registerApolloClient,
} from "@apollo/experimental-nextjs-app-support";
export const { getClient, query, PreloadQuery } = registerApolloClient(
() =>
new ApolloClient({
cache: new InMemoryCache(),
link: new HttpLink({
uri: process.env.NEXT_PUBLIC_GRAPHQL_API,
fetchOptions: { cache: "no-cache" },
}),
}),
);
I noticed your client component ListingCarousel is marked as async. I don't believe React supports async client components yet so perhaps this is your issue? Could you try removing the async keyword and seeing if that helps?
So when i call my query via a suspense i would expect the fallback to show then the data to load and be displayed but what i get is.
The data displayed, a flash of the fallback then data displayed again.
here is my code.
I have also tried useSuspenseQuery and i get the same result.
what i expect to happen is query starts server side, server sends fallback to client, server hydrates client sees data.
The text was updated successfully, but these errors were encountered: