apollographql / apollographql/apollo-client-integrations

DynamicServerError at build time when cache: no-store is enabled

Open
#339 8 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
556
Forks
53
PR merge metrics
No merged PRs in 30d

Description

```ts
export const { query } = registerApolloClient(() => {
return new ApolloClient({
cache: new InMemoryCache(),
link: new HttpLink({
uri: "https://api.github.com/graphql",
// you can disable result caching here if you want to
// (this does not work if you are rendering your page with `export const dynamic = "force-static"`)
fetchOptions: { cache: "no-store" }, // --enabled
headers: {
authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
},
}),
});
});
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the shown registerApolloClient and HttpLink configuration in the Next.js App Router build path, reproducing the failure with fetchOptions.cache set to "no-store". Trace the reported DynamicServerError and compare it with caching enabled; done means the supported configuration no longer throws at build time and the behavior is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, nextjs, typescript
Domain
backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.