Skip to content

Commit 4d7a5ea

Browse files
committed
rename ConvexQueryOptions to QueryOptions for now
1 parent dd572cd commit 4d7a5ea

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
@@ -27,7 +27,7 @@ import {
2727
instantiateNoopLogger,
2828
Logger,
2929
} from "../browser/logging.js";
30-
import { ConvexQueryOptions } from "../browser/query_options.js";
30+
import type { QueryOptions } from "../browser/query_options.js";
3131
import type { Preloaded } from "./hydration.js";
3232
import { parsePreloaded } from "./preloaded.js";
3333

@@ -450,7 +450,7 @@ export class ConvexReactClient {
450450
* an optional extendSubscriptionFor for how long to subscribe to the query.
451451
*/
452452
prewarmQuery<Query extends FunctionReference<"query">>(
453-
queryOptions: ConvexQueryOptions<Query> & {
453+
queryOptions: QueryOptions<Query> & {
454454
extendSubscriptionFor?: number;
455455
},
456456
) {

0 commit comments

Comments
 (0)