File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 55 */
66import 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.
2223export function convexQueryOptions < Query extends FunctionReference < "query" > > (
23- options : ConvexQueryOptions < Query > ,
24- ) : ConvexQueryOptions < Query > {
24+ options : QueryOptions < Query > ,
25+ ) {
2526 return options ;
2627}
Original file line number Diff line number Diff 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" ;
3131import type { Preloaded } from "./hydration.js" ;
3232import { 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 ) {
You can’t perform that action at this time.
0 commit comments