Skip to content

Commit 903e0b5

Browse files
committedFeb 10, 2023
fix(options): normalize correctly query signal
1 parent ba7ee98 commit 903e0b5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed
 

‎packages/orval/src/utils/options.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
RefComponentSuffix,
2626
upath,
2727
SwaggerParserOptions,
28+
isUndefined,
2829
} from '@orval/core';
2930
import chalk from 'chalk';
3031
import { InfoObject } from 'openapi3-ts';
@@ -356,8 +357,12 @@ const normalizeQueryOptions = (
356357
}
357358

358359
return {
359-
...(queryOptions.useQuery ? { useQuery: true } : {}),
360-
...(queryOptions.useInfinite ? { useInfinite: true } : {}),
360+
...(!isUndefined(queryOptions.useQuery)
361+
? { useQuery: queryOptions.useQuery }
362+
: {}),
363+
...(!isUndefined(queryOptions.useInfinite)
364+
? { useInfinite: queryOptions.useInfinite }
365+
: {}),
361366
...(queryOptions.useInfiniteQueryParam
362367
? { useInfiniteQueryParam: queryOptions.useInfiniteQueryParam }
363368
: {}),
@@ -383,7 +388,9 @@ const normalizeQueryOptions = (
383388
),
384389
}
385390
: {}),
386-
...(queryOptions.signal ? { signal: true } : {}),
391+
...(!isUndefined(queryOptions.signal)
392+
? { signal: queryOptions.signal }
393+
: {}),
387394
};
388395
};
389396

1 commit comments

Comments
 (1)

vercel[bot] commented on Feb 10, 2023

@vercel[bot]
Please sign in to comment.