@trpc/next 11.15.2-canary.2 → 11.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@trpc/next",
|
|
4
|
-
"version": "11.15.2
|
|
4
|
+
"version": "11.15.2",
|
|
5
5
|
"description": "The tRPC Next.js library",
|
|
6
6
|
"author": "KATT",
|
|
7
7
|
"license": "MIT",
|
|
@@ -155,5 +155,5 @@
|
|
|
155
155
|
"bin": {
|
|
156
156
|
"intent": "./bin/intent.js"
|
|
157
157
|
},
|
|
158
|
-
"gitHead": "
|
|
158
|
+
"gitHead": "85b0ab89850167ae14ec5376044e2ac2a051c1d8"
|
|
159
159
|
}
|
|
@@ -8,7 +8,7 @@ description: >
|
|
|
8
8
|
type: framework
|
|
9
9
|
library: trpc
|
|
10
10
|
framework: react
|
|
11
|
-
library_version: '11.
|
|
11
|
+
library_version: '11.15.1'
|
|
12
12
|
requires:
|
|
13
13
|
- server-setup
|
|
14
14
|
- client-setup
|
|
@@ -337,6 +337,21 @@ export default async function handler(
|
|
|
337
337
|
}
|
|
338
338
|
```
|
|
339
339
|
|
|
340
|
+
### Limiting batch size with maxBatchSize
|
|
341
|
+
|
|
342
|
+
```ts title="pages/api/trpc/[trpc].ts"
|
|
343
|
+
import { createNextApiHandler } from '@trpc/server/adapters/next';
|
|
344
|
+
import { appRouter } from '../../../server/routers/_app';
|
|
345
|
+
|
|
346
|
+
export default createNextApiHandler({
|
|
347
|
+
router: appRouter,
|
|
348
|
+
createContext: () => ({}),
|
|
349
|
+
maxBatchSize: 10,
|
|
350
|
+
});
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Requests batching more than `maxBatchSize` operations are rejected with a `400 Bad Request` error. Set `maxItems` on your client's `httpBatchLink` to the same value to avoid exceeding the limit.
|
|
354
|
+
|
|
340
355
|
## Common Mistakes
|
|
341
356
|
|
|
342
357
|
### Using ssr: true without understanding implications
|