Skip to content
tRPC

Partners

Prefetching with handles

On this page

Handles help you avoid request waterfalls. The loader, or server component, reads the URL once, starts every query the page needs, and passes each component a reference to its query as a prop.

  • A handle is a query's key and input. It holds no data.
  • The component reads the query from it, fully typed, without naming the procedure or repeating its input.
  • The client reads exactly the query the server started. With plain queryOptions, an input that differs by a typo misses the prefetch and fetches again, silently.

In short

Load the handles where the page starts, and read each one in a component, which never names the procedure or repeats its input:

src/routes/posts.$id.tsx

export const Route = createFileRoute('/posts/$id')({
  loader: async ({ context: { trpc }, params }) => {
    const [handles] = await loadHandles(trpc, {
      post: ensureEntry(trpc.post.byId, { id: params.id }),
    });
    return handles;
  },
  component: PostPage,
});

function PostPage() {
  const handles = Route.useLoaderData();
  const trpc = useTRPC();
  const postQuery = useSuspenseQuery(fromHandle(trpc, handles.post));
  return <h1>{postQuery.data.title}</h1>;
}

The page, a server component, loads the handles:

app/posts/[id]/page.tsx

export default async function PostPage(props: { params: Promise<{ id: string }> }) {
  const { id } = await props.params;
  const [handles] = await loadHandles(trpc, {
    post: ensureEntry(trpc.post.byId, { id }),
  });
  return (
    <HydrateClient>
      <Post post={handles.post} />
    </HydrateClient>
  );
}

A client component, in its own file, reads one:

app/posts/[id]/post.tsx
'use client';


export function Post(props: { post: inferQueryHandle<TRPC['post']['byId']> }) {
  const trpc = useTRPC();
  const postQuery = useSuspenseQuery(fromHandle(trpc, props.post));
  return <h1>{postQuery.data.title}</h1>;
}
  • The handle carries the procedure and its input, typed.
  • The data reaches the browser's cache through TanStack Query's dehydrate and hydrate: see Frameworks.
  • Mutations don't change. To refetch a handle's query after one, invalidate { queryKey: handle.queryKey, exact: true }.

Loading handles

loadHandles(trpc, entries) starts every entry, then resolves to [handles, data]:

import {
  ensureEntry,
  loadHandles,
  prefetchInfiniteEntry,
} from '@trpc/tanstack-react-query/unstable-handles';

const [handles, data] = await loadHandles(trpc, {
  // Waits for the post, unless the cache has it
  post: ensureEntry(trpc.post.byId, { id }),
  // Doesn't wait
  comments: prefetchInfiniteEntry(trpc.post.comments, { postId: id }),
});
handles.post;
post: TRPCQueryHandle<{
    input: {
        id: string;
    };
    output: Post;
    transformer: false;
    errorShape: DefaultErrorShape;
    featureFlags: {
        keyPrefix: false;
    };
}>
data.post;
post: Post
// The comments may have no data yet, so they aren't on `data` data.comments;
Property 'comments' does not exist on type 'DataOf<{ post: TRPCQueryEntry<{ input: { id: string; }; output: Post; transformer: false; errorShape: DefaultErrorShape; featureFlags: { keyPrefix: false; }; }, "ensure">; comments: TRPCInfiniteQueryEntry<...>; }>'.
  • Building an entry starts nothing. The load starts every entry before it waits for any, so their order doesn't matter.
  • handles has a handle for each entry. Return it from the loader, or pass it on as props.
  • In a client component, don't call loadHandles during render: each render would start the entries again. Server components can. A client component that renders before anything loaded its query reads it with useSuspenseQuery(trpc.x.queryOptions(input)).

Using the data in a loader

data has the data of the entries the load waited for. Use it for the page title, a redirect or a not-found check. Return handles, not data, so the data doesn't cross to the browser twice.

Waiting for some, streaming others

List every query in one load, whether the page waits for it or not. They all start together. A second load waits for everything the first one waited for, so use one only for dependent queries.

Each entry chooses whether the page waits for its query:

prefetchEntryensureEntryfetchEntry
Page waits for dataNoYesYes
In dataNoYesYes
With stale dataRefetches in the backgroundResolves at once, refetches in the backgroundWaits for the refetch
Reader's first renderLoading state, or cached dataThe dataThe data
When the request failsThe reader gets the errorThe load rejects, unless it had cached dataThe load rejects
Start queries in a loaderOpen all posts or another article, then come back. Within 5 seconds, the page uses the cache. After that, the data is stale. Each request takes its own time, a little different on every run.
Start queries with
Latency

The page shows at once, with skeletons until the data comes in. Stale data shows at once and refetches.

← All posts

Comments

Network

No requests yet.

Load handles where the code can wait:

Your appWhereProxy
TanStack Start, TanStack RouterRoute loadersThe proxy in your router context
Next.js App RouterServer componentsThe server proxy from trpc/server.tsx
A SPA without loadersEvent handlers, such as a link's hoveruseTRPC()

Conditional queries

Put TanStack Query's skipToken in place of an entry to start nothing for it. Here, a post page loads its comments only when the URL opens the comments tab, /posts/1?tab=comments:

import { skipToken } from '@tanstack/react-query';
import {
  ensureEntry,
  loadHandles,
  prefetchInfiniteEntry,
} from '@trpc/tanstack-react-query/unstable-handles';
import { z } from 'zod';

export const postRoute = createRoute({
  getParentRoute: () => rootRoute,
  path: '/posts/$id',
  validateSearch: z.object({
    tab: z.enum(['post', 'comments']).default('post'),
  }),
  loaderDeps: ({ search }) => ({ tab: search.tab }),
  loader: async ({ context: { trpc }, params: { id }, deps }) => {
    const [handles] = await loadHandles(trpc, {
      post: ensureEntry(trpc.post.byId, { id }),
      comments:
        deps.tab === 'comments'
          ? prefetchInfiniteEntry(trpc.post.comments, { postId: id })
          : skipToken,
    });
    handles.comments;
comments: TRPCInfiniteQueryHandle<{
    input: {
        postId: string;
        limit?: number | undefined;
        cursor?: number | null | undefined;
    };
    output: {
        items: {
            id: string;
            text: string;
        }[];
        nextCursor: number | null;
    };
    transformer: false;
    errorShape: DefaultErrorShape;
    featureFlags: {
        keyPrefix: false;
    };
}> | undefined
return handles; }, });
  • Its handle is undefined, so render the reader only when there's a handle: {handles.comments && <Comments comments={handles.comments} />}.
  • It has no key in handles, data or loadHandlesSettled's results, so the handles still serialize as Next.js props.
  • Take the condition from what the loader knows: the URL, as here, the session, or another load's data. See Start every query from the URL and Dependent queries.

TanStack Query equivalents

Each entry is one TanStack Query call:

tRPCTanStack Query
prefetchEntry(trpc.x, input, opts)void queryClient.prefetchQuery(trpc.x.queryOptions(input, opts))
ensureEntry(trpc.x, input, opts)await queryClient.ensureQueryData({ ...trpc.x.queryOptions(input, opts), revalidateIfStale: true })
fetchEntry(trpc.x, input, opts)await queryClient.fetchQuery(trpc.x.queryOptions(input, opts))
prefetchInfiniteEntry, ensureInfiniteEntry, fetchInfiniteEntryprefetchInfiniteQuery, ensureInfiniteQueryData (with revalidateIfStale: true), fetchInfiniteQuery
fromHandle(trpc, handle, opts)trpc.x.queryOptions(handle.input, opts), with x taken from the handle

The queryClient is the one the proxy was created with. The entry names follow the TanStack Query method each one calls.

Options:

  • input is optional when the procedure's is: prefetchEntry(trpc.viewer).
  • opts takes staleTime, gcTime, retry, retryDelay, meta and trpc request options. They apply to the load's request; readers use the options passed to fromHandle.

prefetchEntry: don't wait

  • The page renders at once, and the data streams in.
  • The reader shows cached data, or suspends. Give it its own <Suspense>, or the nearest boundary above shows its fallback, which may be the whole page.
  • It never makes the load reject. The reader gets the error: see Errors.
  • Use it for slow queries, content below the fold and side panels.

ensureEntry: wait

  • The load waits until the cache has data, so the reader renders it at once.
  • With cached data, even stale, it resolves at once and refetches in the background.
  • It rejects only if the cache had no data and the request fails.
  • Use it for data the page can't render without, or needs before rendering.

fetchEntry: wait for fresh data

  • Like ensureEntry, but with stale data it waits for the refetch.
  • Use it when the loader reads the data and needs it fresh, such as for a redirect.
  • In a browser loader, prefer ensureEntry: a fetch entry holds up the navigation until the refetch is done.
  • TanStack Router shows a visited page with its last loader data while the loader reruns. To wait, set defaultStaleReloadMode, or a loader's staleReloadMode, to 'blocking'.
  • In server components, ensure and fetch behave the same: the request's QueryClient starts empty.

Start every query from the URL

A loader runs before anything renders, and all it has is the URL: params, search params and, on the server, the session. If every input comes from those, every request starts with the navigation.

  • Path params name the thing: /posts/$slug.
  • Search params hold filters, sort and page. Keep them out of component state: a loader can't see it, the back button doesn't restore it, and a shared link loses it.
Keep the sort in
Page 1 of 5
  • Typesafe APIs without codegen▲ 3
  • Streaming responses over HTTP▲ 40
  • Subscriptions with server-sent events▲ 27

What the loader sees

loaderDeps: ({ search }) => search,
// { sort: 'new', page: 1 }
loader: ({ deps }) =>
  loadHandles(trpc, {
    posts: prefetchEntry(trpc.post.list, deps),
  }),

Requests

  1. loaderpost.list({ sort: 'new', page: 1 })done
The URL holds the whole input. Every navigation, the back button and a reload give the loader everything it needs, so the list starts before the page renders.

With handles, they all start together. Without, each starts once the component above it renders:

With handles      Without
|-> post.byId     |-> post.byId
|-> post.comments   |-> post.comments
|-> post.byAuthor     |-> post.byAuthor
Where the queries startReload, open all posts, or open another article, and watch when each request starts and ends. Each one takes its own time.
Start the queries in
Latency

The route loader starts every query from the URL: the article's id, or the list's page. One round trip.

← All posts

Comments

Network

No requests yet.

If the URL isn't enough, reshape the procedure

A procedure that takes an id from another query forces a waterfall on every page that calls it. Fix the procedure, not the page:

  • Take what the URL has. Accept the slug and look up the id on the server.
  • Return the joined data. Return the post with its author, not an author id.

The server sits next to the database, so the lookup costs a query there, not a round trip from the browser.

Before: the comments and the author need ids that only the post has.

The loader for /posts/$slug
async function loader(params: { slug: string }) {
  const [first, { post }] = await loadHandles(trpc, {
    post: ensureEntry(trpc.post.bySlug, { slug: params.slug }),
  });
  // Nothing below can start until the post has arrived
  const [second] = await loadHandles(trpc, {
    comments: prefetchInfiniteEntry(trpc.post.comments, {
      postId: post.id,
    }),
    author: prefetchEntry(trpc.author.byId, { id: post.authorId }),
  });
  return { ...first, ...second };
}
post.bySlug     |-------|
post.comments           |-------|
author.byId             |-------|

After: post.comments takes the slug, and post.bySlug returns the author:

server/routers/_app.ts
import { z } from 'zod';
import { db } from './db';
import { t } from './trpc';

export const appRouter = t.router({
  post: t.router({
    bySlug: t.procedure
      .input(z.object({ slug: z.string() }))
      .query(async ({ input }) => {
        const post = await db.post.bySlug(input.slug);
        return { ...post, author: await db.author.byId(post.authorId) };
      }),
    comments: t.procedure
      .input(
        z.object({ slug: z.string(), cursor: z.number().nullish() }),
      )
      .query(async ({ input }) => {
        const post = await db.post.bySlug(input.slug);
        return db.comment.list({
          postId: post.id,
          cursor: input.cursor ?? null,
        });
      }),
  }),
});
The loader for /posts/$slug
async function loader(params: { slug: string }) {
  // Both start from the URL, together
  const [handles] = await loadHandles(trpc, {
    comments: prefetchInfiniteEntry(trpc.post.comments, {
      slug: params.slug,
    }),
    post: ensureEntry(trpc.post.bySlug, { slug: params.slug }),
  });
  return handles;
}
post.bySlug     |-------|
post.comments   |-------|

Reading a handle

fromHandle(trpc, handle, opts?) returns trpc.<path>.queryOptions(handle.input, opts), or infiniteQueryOptions for an infinite handle. Pass it to any TanStack Query hook:

const trpc = useTRPC();
const postQuery = useSuspenseQuery(fromHandle(trpc, props.post));
const titleQuery = useQuery(fromHandle(trpc, props.post, { select: (post) => post.title }));
const [aQuery, bQuery] = useSuspenseQueries({
  queries: [fromHandle(trpc, props.a), fromHandle(trpc, props.b)],
});
  • Only loadHandles makes handles. A hand-written object doesn't type-check, and fromHandle throws on it.
  • handle.input is the typed input. An infinite handle's leaves out cursor and direction.
  • Reads share cache entries with trpc.<path>.queryOptions(input).
  • handle.queryKey carries no data type, so the handle stays serializable. For a typed key, use fromHandle(trpc, handle).queryKey or trpc.post.byId.queryKey(handle.input).

Typing props

Type props with inferQueryHandle<TRPC['post']['byId']>, or inferInfiniteQueryHandle for an infinite handle. Export type TRPC = TRPCOptionsProxy<AppRouter> from trpc/client.tsx once.

Reading with useQuery

With useQuery, no Suspense boundary is needed:

  • It renders status: 'pending' until the data arrives, and 'success' at once after an ensure or fetch entry.
  • With server rendering, read a prefetch entry's handle with useSuspenseQuery. Otherwise the server can render the loading state while the browser has the data, a hydration mismatch (TanStack/query#9399).

To change the input in the component, for a search term the URL can't hold, call the procedure and start from the handle's input:

const [term, setTerm] = useState(props.comments.input.term);
const commentsQuery = useSuspenseInfiniteQuery(
  trpc.post.comments.infiniteQueryOptions(
    { ...props.comments.input, term: useDeferredValue(term) },
    { getNextPageParam: (last) => last.nextCursor },
  ),
);
  • While the input matches the handle's, it reads the loader's cache entry.
  • Render <Comments key={postId} … />, so a new post resets the term.
  • For sort and filters, use a search param instead.

When the cache loses the data

A handle carries no data, and the cache can lose it even after an ensure entry:

  • resetQueries() clears it and refetches at once.
  • removeQueries() and clear(), such as on logout, drop it. The reader loads it again when it next renders.
  • After gcTime unused, TanStack Query drops it.
  • invalidateQueries() keeps it and refetches in the background, so nothing shows a loading state.

So give every reader a loading state: a Suspense boundary, or a 'pending' case.

Infinite queries

For procedures with a cursor input, use prefetchInfiniteEntry, ensureInfiniteEntry and fetchInfiniteEntry. They load one page, or more with pages:

const [handles, data] = await loadHandles(trpc, {
  comments: ensureInfiniteEntry(
    trpc.post.comments,
    { postId: id, limit: 20 },
    { pages: 3, getNextPageParam: (last) => last.nextCursor },
  ),
});
data.comments.pages;
InfiniteData<{ items: { id: string; text: string; }[]; nextCursor: number | null; }, number | null>.pages: {
    items: {
        id: string;
        text: string;
    }[];
    nextCursor: number | null;
}[]

The data of every page fetched so far, in order.

  • pages is how many pages the load fetches, also when it refetches stale pages: the cache then keeps only that many. To refetch every page the reader loaded, leave it out.

  • Functions can't cross to the client, so pass getNextPageParam again when you read:

    fromHandle(trpc, props.comments, { getNextPageParam: (last) => last.nextCursor })
  • Also pass it to entries in loaders that run in the browser. Refetching stale pages needs it from page two on.

  • Type props with inferInfiniteQueryHandle.

Dependent queries

A query whose input comes from another query's result is a waterfall. Each step costs a round trip. First try to reshape the procedure. If you can't, there are two ways, and both pay the round trip.

In a loader

Load the first query, then build the second load from its data:

const [first, { post }] = await loadHandles(trpc, {
  post: ensureEntry(trpc.post.byId, { id }),
  comments: prefetchInfiniteEntry(trpc.post.comments, { postId: id }),
});
const [second] = await loadHandles(trpc, {
  moreByAuthor: prefetchInfiniteEntry(trpc.post.byAuthor, {
    authorId: post.authorId,
  }),
});
const handles = { ...first, ...second };

In a component

Read it in the component that gets the input:

const postsQuery = useSuspenseInfiniteQuery(
  trpc.post.byAuthor.infiniteQueryOptions(
    { authorId },
    { getNextPageParam: (last) => last.nextCursor },
  ),
);
  • In TanStack Router, beforeLoad can wait for the first query before the loader runs: see TanStack Start.

Frameworks

Each framework loads the handles where the page starts and passes them to the components that read them. Set tRPC up with the framework's guide first.

On a page

After the TanStack Start setup, the route's loader loads the handles and its component passes them on:

src/routes/posts.$id.tsx

export const Route = createFileRoute('/posts/$id')({
  loader: async ({ context: { trpc }, params }) => {
    const [handles] = await loadHandles(trpc, {
      post: ensureEntry(trpc.post.byId, { id: params.id }),
      comments: prefetchInfiniteEntry(trpc.post.comments, { postId: params.id }),
    });
    return handles;
  },
  component: PostPage,
});

function PostPage() {
  const handles = Route.useLoaderData();
  return (
    <>
      <Post post={handles.post} />
      <Suspense fallback={<p>Loading comments…</p>}>
        <Comments comments={handles.comments} />
      </Suspense>
    </>
  );
}

On a page

After the Next.js App Router setup, export HydrateClient = unstable_createHydrateClient(getQueryClient) from trpc/server.tsx. The page, a server component, loads the handles and passes them to client components:

app/posts/[id]/page.tsx

export default async function PostPage(props: { params: Promise<{ id: string }> }) {
  const { id } = await props.params;
  const [handles] = await loadHandles(trpc, {
    post: ensureEntry(trpc.post.byId, { id }),
    comments: prefetchInfiniteEntry(trpc.post.comments, { postId: id }),
  });
  return (
    <HydrateClient>
      <Post post={handles.post} />
      <Suspense fallback={<p>Loading comments…</p>}>
        <Comments comments={handles.comments} />
      </Suspense>
    </HydrateClient>
  );
}
app/posts/[id]/post.tsx
'use client';


export function Post(props: { post: inferQueryHandle<TRPC['post']['byId']> }) {
  const trpc = useTRPC();
  const postQuery = useSuspenseQuery(fromHandle(trpc, props.post));
  return <h1>{postQuery.data.title}</h1>;
}

HydrateClient

  • It sends the request's queries to the browser, pending ones too, which stream in as they settle.
  • It sends each query once per request, so a nested server component can load more handles and render its own. A query is sent again only when the server has newer data.
  • It works only in server components, and for queryClient.prefetchQuery too.
  • Handle inputs cross through React's serialization, not your transformer. Keep them to JSON values and Dates.
  • For a 404, use an ensure entry and call notFound(): see Errors.

Metadata, static and ISR pages

  • generateMetadata gets the page's query client. Fetch there, and the page's ensure entry reuses the data.
  • A page whose tRPC context reads headers() renders on every request. loadHandles lets Next.js see that, so the build marks the page dynamic.
  • To prerender the page and revalidate it, load it with a proxy whose context reads no request data, trpcStatic from Static and ISR pages:
app/posts/[id]/page.tsx

type Props = { params: Promise<{ id: string }> };

export const revalidate = 60;

export function generateStaticParams() {
  return [{ id: '1' }];
}

export async function generateMetadata(props: Props) {
  const { id } = await props.params;
  const post = await getQueryClient().fetchQuery(
    trpcStatic.post.byId.queryOptions({ id }),
  );
  return { title: post.title };
}

export default async function PostPage(props: Props) {
  const { id } = await props.params;
  const [handles] = await loadHandles(trpcStatic, {
    post: ensureEntry(trpcStatic.post.byId, { id }),
  });
  return (
    <HydrateClient>
      <Post post={handles.post} />
    </HydrateClient>
  );
}

Errors

With ensure and fetch entries

When an entry the load waits for fails, loadHandles rejects with a TRPCEntryError. isTRPCEntryError(error, trpc.post.byId) checks which procedure failed and types error.cause:

import {
  ensureEntry,
  ensureInfiniteEntry,
  isTRPCEntryError,
  loadHandles,
} from '@trpc/tanstack-react-query/unstable-handles';

async function loader(id: string) {
  const [handles] = await loadHandles(trpc, {
    post: ensureEntry(trpc.post.byId, { id }),
    comments: ensureInfiniteEntry(trpc.post.comments, { postId: id }),
  }).catch((error: unknown) => {
    if (isTRPCEntryError(error, trpc.post.byId) && error.code === 'NOT_FOUND') {
      notFound();
    }
    if (isTRPCEntryError(error, trpc.post.comments)) {
      reportError(error.cause);
error: TRPCEntryError<{
    input: {
        postId: string;
        limit?: number | undefined;
        cursor?: number | null | undefined;
    };
    output: {
        items: {
            id: string;
            text: string;
        }[];
        nextCursor: number | null;
    };
    transformer: false;
    errorShape: DefaultErrorShape;
    featureFlags: {
        keyPrefix: false;
    };
}>
} throw error; }); return handles; }
  • error.key is the entry's key, error.path the procedure, error.code the tRPC code.
  • The load rejects on the first failure, without waiting for the others.
  • An error with a digest, such as the one Next.js's headers() throws in a static render, is rethrown as it is, also by loadHandlesSettled, so Next.js still sees it. A procedure's errors arrive as a TRPCError, as with fetchQuery.

Errors as values

loadHandlesSettled never rejects for a failed entry. It returns each waited-for entry's result as a value:

import {
  ensureEntry,
  loadHandlesSettled,
  prefetchInfiniteEntry,
} from '@trpc/tanstack-react-query/unstable-handles';

const [handles, results] = await loadHandlesSettled(trpc, {
  post: ensureEntry(trpc.post.byId, { id }),
  comments: prefetchInfiniteEntry(trpc.post.comments, { postId: id }),
});
if (results.post.status === 'error') {
  if (results.post.error.code === 'NOT_FOUND') {
    notFound();
  }
  throw results.post.error;
}
results.post.data.title;
data: Post

With prefetch entries

A prefetch entry never makes the load reject. The reader gets the query's own error: useQuery returns status: 'error', and useSuspenseQuery throws to the nearest error boundary, unless the cache has data to keep showing. To report these in one place, use your QueryCache's onError.

Invalidation

Handles use normal tRPC query keys. Pass any of these to invalidateQueries:

  • { queryKey: handle.queryKey, exact: true }: the handle's own query. Without exact, it also matches inputs that extend the handle's.
  • trpc.post.pathFilter(): every query under post.
  • trpc.post.byId.queryFilter(input), or infiniteQueryFilter for an infinite handle.

To update data in place, use queryClient.setQueryData(trpc.post.byId.queryKey(handle.input), …).

Hydrated data keeps the server's fetch time. Set a staleTime above 0, as the setup guides do, or the client refetches right after hydration.

Testing

Load handles over a test QueryClient, seeded with fixture data:

post.test.tsx
import { QueryClient } from '@tanstack/react-query';
import { createTRPCOptionsProxy } from '@trpc/tanstack-react-query';
import { loadHandles, prefetchEntry } from '@trpc/tanstack-react-query/unstable-handles';
import { appRouter } from './router';

const queryClient = new QueryClient({
  defaultOptions: { queries: { staleTime: Infinity, retry: false } },
});
const trpc = createTRPCOptionsProxy({ router: appRouter, ctx: {}, queryClient });

queryClient.setQueryData(trpc.post.byId.queryKey({ id: '1' }), {
  id: '1',
  title: 'Hello',
});
const [{ post }] = await loadHandles(trpc, {
  post: prefetchEntry(trpc.post.byId, { id: '1' }),
});
  • Render the component under QueryClientProvider and TRPCProvider with the same queryClient.
  • Leave out setQueryData to run the real procedure.

FAQ

Are handles safe to send to the browser?

Yes. A handle names a query the browser could call anyway, and every refetch runs validation and auth on the server again.

A handle does carry its input to the browser, as hydrated query keys already do. Only use inputs you'd show the client.

Where don't handles work?

  • Server functions and server actions: their QueryClient never hydrates the page, so return data instead.
  • Outside hydration: a reader rendered on the server outside HydrateClient or HydrationBoundary fetches its query again. In development, tRPC warns once per query.
  • URLs and storage: a handle there gains nothing over its input.

Why functions, not methods on trpc?

Methods on trpc return plain TanStack Query options. Handles are helpers on top, and apps that don't use them don't load their code.

Why one load call, not one per query?

So a loader can't make a waterfall by the order of its lines.