© 2026 Hedgehog Software, LLC
const CompanyPage: NextPage<{ asxCode: string }> = ({ asxCode }) => { const { data } = api.company.getByCode.useQuery( ... ); // Quick query const { data: historicalData } = api.company.getHistorical.useQuery( ... ); // Long query ... }
http://localhost:3000/api/trpc/company.getByCode,company.getHistorical?batch=1&input=...
getHistorical
data
getByCode
src/utils/api.ts
links: [ loggerLink({ enabled: (opts) => process.env.NODE_ENV === "development" || (opts.direction === "down" && opts.result instanceof Error), }), // httpBatchLink({ // url: `${getBaseUrl()}/api/trpc`, // }), splitLink({ condition(op) { // check for context property `skipBatch` return op.context.skipBatch === true; }, // when condition is true, use normal request true: httpLink({ url, }), // when condition is false, use batching false: httpBatchLink({ url, }), }), ],
api.company.getHistorical.useQuery( { asxCode: asxCode.toUpperCase(), }, { context: { skipBatch: true } } );