Skip to content

Commit

Permalink
freeze transported data immediately when queuing injection
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Feb 6, 2025
1 parent 413d33b commit 76d5c6c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/tanstack-start/src/ApolloProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,12 @@ const WrappedApolloProvider = WrapApolloProvider<{ router: AnyRouter }>(

function transportEvent(event: QueryEvent) {
event.id = id;
ssr.injectScript(
() =>
`__APOLLO_EVENTS__.push(${jsesc(event, {
isScriptContext: true,
wrap: true,
json: true,
})})`
);
const script = `__APOLLO_EVENTS__.push(${jsesc(event, {
isScriptContext: true,
wrap: true,
json: true,
})})`;
ssr.injectScript(() => script);
}

// transport initial event
Expand Down

0 comments on commit 76d5c6c

Please sign in to comment.