Skip to content

Commit 28bdca4

Browse files
committed
docs: clarify conditional query parameters
1 parent 594355b commit 28bdca4

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

website/docs/query-client/getInfiniteQueryData.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const data = api.<service>.<operation>.getInfiniteQueryData(parameters);
1414
### Arguments
1515

1616
1. `parameters: { path, query, header, body } | InfiniteQueryKey | void`
17-
- **Optional** parameters to retrieve the data from the cache.
17+
- **Required only if OpenAPI specification defines required parameters** to retrieve the data from the cache.
18+
- If the operation has no required parameters according to OpenAPI, you can omit this argument.
1819
- For operations generated with `--queryable-write-operations`, query parameters may also include `body`.
1920
In that mode, `body` is part of the infinite query key and cache identity.
2021
- Instead of an object with `{ path, query, header, body }`, you can pass a typed infinite query key from `getInfiniteQueryKey(...)`.

website/docs/query-client/getInfiniteQueryKey.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const queryKey = api.<service>.<operation>.getInfiniteQueryKey(parameters);
1515
### Arguments
1616

1717
1. - `parameters: { path, query, header, body } | void`
18-
- **Optional**, OpenAPI request parameters for the query, strictly-typed ✨
18+
- **Required only if OpenAPI specification defines required parameters**, strictly-typed ✨
19+
- If the operation has no required parameters according to OpenAPI, you can omit this argument.
1920
- For operations generated with `--queryable-write-operations`, query parameters may also include `body`.
2021
In that mode, `body` is part of the infinite query key and cache identity.
2122
- The returned `InfiniteQueryKey` can be passed to query-client methods that accept typed infinite query key arrays.

website/docs/query-client/getQueryData.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ const data = api.<service>.<operation>.getQueryData(
1919
## Arguments
2020

2121
1. `parameters: { path, query, header, body } | QueryKey | void`
22-
- **Optional** parameters to retrieve the data from the _Query Cache_.
22+
- **Required only if OpenAPI specification defines required parameters** to retrieve the data from the _Query Cache_.
23+
- If the operation has no required parameters according to OpenAPI, you can omit this argument.
2324
- For operations generated with `--queryable-write-operations`, query parameters may also include `body`.
2425
In that mode, `body` is part of the query key and cache identity for query-client methods.
2526
- Instead of an object with `{ path, query, header, body }`, you can pass a typed `QueryKey` array.

website/docs/query-client/getQueryKey.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const queryKey = api.<service>.<operation>.getQueryKey(parameters);
1717
### Arguments
1818

1919
1. - `parameters: { path, query, header, body } | void`
20-
- **Optional**, OpenAPI request parameters for the query, strictly-typed ✨
20+
- **Required only if OpenAPI specification defines required parameters**, strictly-typed ✨
21+
- If the operation has no required parameters according to OpenAPI, you can omit this argument.
2122
- For operations generated with `--queryable-write-operations`, query parameters may also include `body`.
2223
In that mode, `body` is part of the query key and cache identity for query-client methods.
2324
- The returned `QueryKey` can be passed to query-client methods that accept typed query key arrays.

0 commit comments

Comments
 (0)