
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@apollo/client-integration-tanstack-start
Advanced tools
This package provides integrations between Apollo Client and TanStack Start to support modern streaming SSR.
This package provides integrations between Apollo Client and TanStack Start to support modern streaming SSR.
Install dependencies:
npm i @apollo/client-integration-tanstack-start @apollo/client graphql
In your routes/__root.tsx, change from createRootRoute to createRootRouteWithContext to provide the right context type to your application.
+import type { ApolloClientIntegration } from "@apollo/client-integration-tanstack-start";
import {
- createRootRoute
+ createRootRouteWithContext
} from "@tanstack/react-router";
-export const Route = createRootRoute({
+export const Route = createRootRouteWithContext<ApolloClientIntegration.RouterContext>()({
In your router.tsx, set up your Apollo Client instance and run routerWithApolloClient
import {
routerWithApolloClient,
ApolloClient,
InMemoryCache,
} from "@apollo/client-integration-tanstack-start";
import { HttpLink } from "@apollo/client";
import { createRouter } from "@tanstack/react-router";
import { routeTree } from "./routeTree.gen";
export function getRouter() {
const apolloClient = new ApolloClient({
cache: new InMemoryCache(),
link: new HttpLink({ uri: "https://your.graphql.api" }),
});
const router = createTanStackRouter({
routeTree,
context: {
...routerWithApolloClient.defaultContext,
},
});
return routerWithApolloClient(router, apolloClient);
}
[!IMPORTANT]
ApolloClientandInMemoryCacheneed to be imported from@apollo/client-integration-tanstack-start, not from@apollo/client.
loader with preloadQuery and useReadQueryimport { useReadQuery } from "@apollo/client";
import { createFileRoute } from "@tanstack/react-router";
export const Route = createFileRoute("/loader-defer")({
component: RouteComponent,
loader: ({ context: { preloadQuery } }) => {
const queryRef = preloadQuery(QUERY, {
variables: { myVariable: "myValue" },
});
return {
queryRef,
};
},
});
function RouteComponent() {
const { queryRef } = Route.useLoaderData();
const { data } = useReadQuery(queryRef);
return (
<div> do something with `data` here </div>
)
}
useSuspenseQueryYou can also use the suspenseful Apollo Client api useSuspenseQuery (or useQueryRef and useReadQuery) directly into your component without a loader:
import { useSuspenseQuery } from "@apollo/client";
import { createFileRoute } from "@tanstack/react-router";
export const Route = createFileRoute("/myPage")({
component: RouteComponent,
});
function RouteComponent() {
const { data } = useSuspenseQuery(QUERY);
return <div> do something with `data` here </div>;
}
FAQs
This package provides integrations between Apollo Client and TanStack Start to support modern streaming SSR.
We found that @apollo/client-integration-tanstack-start demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.