Skip to content

Commit

Permalink
refactor: make query initial instructions optional
Browse files Browse the repository at this point in the history
  • Loading branch information
tien committed Jul 5, 2024
1 parent 31d82b2 commit 36c77f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/QueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export default class Query<
{
#instructions: TInstructions;

constructor(instructions: TInstructions) {
constructor(instructions: TInstructions = [] as unknown as TInstructions) {
this.#instructions = instructions;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/hooks/useQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function useQueryRefresher<
return;
}

const query = builder(new Query([]));
const query = builder(new Query());

if (!query) {
return;
Expand Down Expand Up @@ -102,7 +102,7 @@ export function useLazyLoadQueryWithRefresh<
const chainId = useChainId(options);

const query = useMemo(
() => (!builder ? undefined : builder(new Query([]))),
() => (!builder ? undefined : builder(new Query())),
[builder],
);

Expand Down

0 comments on commit 36c77f3

Please sign in to comment.