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 @@ -32,12 +32,12 @@ import {
3232 instantiateNoopLogger ,
3333 Logger ,
3434} from "../browser/logging.js" ;
35- import { ConvexQueryOptions } from "../browser/query_options.js" ;
3635import { LoadMoreOfPaginatedQuery } from "../browser/sync/pagination.js" ;
3736import {
3837 PaginatedQueryClient ,
3938 ExtendedTransition ,
4039} from "../browser/sync/paginated_query_client.js" ;
40+ import type { QueryOptions } from "../browser/query_options.js" ;
4141import type { Preloaded } from "./hydration.js" ;
4242import { 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 ) {
You can’t perform that action at this time.
0 commit comments