Skip to content

Commit a1db464

Browse files
committed
Tweak schema doc phrasing
1 parent d426ea6 commit a1db464

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

docs/rtk-query/api/createApi.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,9 @@ async function onCacheEntryAdded(
838838

839839
### Schema Validation
840840

841-
Endpoints can have schemas for runtime validation of various values. Any [Standard Schema](https://standardschema.dev/) compliant library can be used.
841+
Endpoints can have schemas for runtime validation of query args, responses, and errors. Any [Standard Schema](https://standardschema.dev/) compliant library can be used.
842+
843+
When used with TypeScript, schemas can also be used to [infer the type of that value instead of having to declare it](../usage-with-typescript.mdx#schema-validation).
842844

843845
:::warning
844846

docs/rtk-query/usage-with-typescript.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ function AddPost() {
706706

707707
## Schema Validation
708708

709-
Endpoints can have schemas for runtime validation of various values. Any [Standard Schema](https://standardschema.dev/) compliant library can be used. See [API reference](./api/createApi.mdx#schema-validation) for full list of available schemas.
709+
Endpoints can have schemas for runtime validation of query args, responses, and errors. Any [Standard Schema](https://standardschema.dev/) compliant library can be used. See [API reference](./api/createApi.mdx#schema-validation) for full list of available schemas.
710710

711711
When following the default approach of explicitly specifying type parameters for queries and mutations, the schemas will be required to match the types provided.
712712

docs/rtk-query/usage/infinite-queries.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ const projectsApi = createApi({
534534

535535
## Runtime Validation using Schemas
536536

537-
Endpoints can use any [Standard Schema](https://standardschema.dev/) compliant library for runtime validation of various values. See [API reference](../api/createApi.mdx#schema-validation) for full list of available schemas.
537+
Endpoints can use any [Standard Schema](https://standardschema.dev/) compliant library for runtime validation of query args, responses, and errors. See [API reference](../api/createApi.mdx#schema-validation) for full list of available schemas.
538+
539+
When used with TypeScript, schemas can also be used to [infer the type of that value instead of having to declare it](../usage-with-typescript.mdx#schema-validation).
538540

539541
Most commonly, you'll want to use `responseSchema` to validate the response from the server (or `rawResponseSchema` when using `transformResponse`).
540542

docs/rtk-query/usage/mutations.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ export const {
329329

330330
## Runtime Validation using Schemas
331331

332-
Endpoints can use any [Standard Schema](https://standardschema.dev/) compliant library for runtime validation of various values. See [API reference](../api/createApi.mdx#schema-validation) for full list of available schemas.
332+
Endpoints can use any [Standard Schema](https://standardschema.dev/) compliant library for runtime validation of query args, responses, and errors. See [API reference](../api/createApi.mdx#schema-validation) for full list of available schemas.
333+
334+
When used with TypeScript, schemas can also be used to [infer the type of that value instead of having to declare it](../usage-with-typescript.mdx#schema-validation).
333335

334336
Most commonly, you'll want to use `responseSchema` to validate the response from the server (or `rawResponseSchema` when using `transformResponse`).
335337

docs/rtk-query/usage/queries.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ const { status, data, error, refetch } = dispatch(
352352

353353
## Runtime Validation using Schemas
354354

355-
Endpoints can use any [Standard Schema](https://standardschema.dev/) compliant library for runtime validation of various values. See [API reference](../api/createApi.mdx#schema-validation) for full list of available schemas.
355+
Endpoints can use any [Standard Schema](https://standardschema.dev/) compliant library for runtime validation of query args, responses, and errors. See [API reference](../api/createApi.mdx#schema-validation) for full list of available schemas.
356+
357+
When used with TypeScript, schemas can also be used to [infer the type of that value instead of having to declare it](../usage-with-typescript.mdx#schema-validation).
356358

357359
Most commonly, you'll want to use `responseSchema` to validate the response from the server (or `rawResponseSchema` when using `transformResponse`).
358360

0 commit comments

Comments
 (0)