Skip to content

Commit 44a4677

Browse files
committed
rename ConvexQueryOptions to QueryOptions for now
1 parent 4d7d27f commit 44a4677

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

npm-packages/convex/src/browser/query_options.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@
55
*/
66
import type { FunctionArgs, FunctionReference } from "../server/api.js";
77

8-
// TODO if this type can encompass all use cases we can add not requiring args for queries
9-
// that don't take arguments. Goal would be that queryOptions allows leaving out args,
10-
// but queryOptions returns an object that always contains args. Helpers, "middleware,"
11-
// anything that intercepts these arguments
128
/**
139
* Query options.
1410
*/
15-
export type ConvexQueryOptions<Query extends FunctionReference<"query">> = {
11+
export type QueryOptions<Query extends FunctionReference<"query">> = {
12+
/**
13+
* The query function to run.
14+
*/
1615
query: Query;
16+
/**
17+
* The arguments to the query function.
18+
*/
1719
args: FunctionArgs<Query>;
18-
extendSubscriptionFor?: number;
1920
};
2021

2122
// This helper helps more once we have more inference happening.
2223
export function convexQueryOptions<Query extends FunctionReference<"query">>(
23-
options: ConvexQueryOptions<Query>,
24-
): ConvexQueryOptions<Query> {
24+
options: QueryOptions<Query>,
25+
) {
2526
return options;
2627
}

npm-packages/convex/src/react/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ import {
3232
instantiateNoopLogger,
3333
Logger,
3434
} from "../browser/logging.js";
35-
import { ConvexQueryOptions } from "../browser/query_options.js";
3635
import { LoadMoreOfPaginatedQuery } from "../browser/sync/pagination.js";
3736
import {
3837
PaginatedQueryClient,
3938
ExtendedTransition,
4039
} from "../browser/sync/paginated_query_client.js";
40+
import type { QueryOptions } from "../browser/query_options.js";
4141
import type { Preloaded } from "./hydration.js";
4242
import { parsePreloaded } from "./preloaded.js";
4343

@@ -539,7 +539,7 @@ export class ConvexReactClient {
539539
* an optional extendSubscriptionFor for how long to subscribe to the query.
540540
*/
541541
prewarmQuery<Query extends FunctionReference<"query">>(
542-
queryOptions: ConvexQueryOptions<Query> & {
542+
queryOptions: QueryOptions<Query> & {
543543
extendSubscriptionFor?: number;
544544
},
545545
) {

0 commit comments

Comments
 (0)