Skip to content

Commit 49187c9

Browse files
jdollen1ru4l
andauthored
fix: CLI hive. json default (#6919)
Co-authored-by: Laurin Quast <[email protected]>
1 parent ad70160 commit 49187c9

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.changeset/swift-parents-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-hive/cli': patch
3+
---
4+
5+
fix fallback when hive.json is used but does not provide the requested value

packages/libraries/cli/src/base-command.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,9 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
151151
} else if (envName && env[envName] !== undefined) {
152152
value = env[envName] as TArgs[keyof TArgs] as NonNullable<GetConfigurationValueType<TKey>>;
153153
} else {
154-
const configValue = this._userConfig!.get(key) as NonNullable<
155-
GetConfigurationValueType<TKey>
156-
>;
154+
const configValue = this._userConfig!.get(key) as GetConfigurationValueType<TKey>;
157155

158-
if (configValue !== undefined) {
156+
if (configValue != null) {
159157
value = configValue;
160158
} else if (defaultValue) {
161159
value = defaultValue;

packages/web/docs/src/content/gateway/other-features/security/demand-control.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ export const gatewayConfig = defineConfig({
6262

6363
When a query is planned by the gateway,
6464

65-
- For each operation, the `operationTypeCost` function is called with the operation type. (By default
66-
only mutations have a cost `10`)
65+
- For each operation, the `operationTypeCost` function is called with the operation type. (By
66+
default only mutations have a cost `10`)
6767
- For each field in the operation, the `fieldCost` function is called with the field node. (By
6868
default fields have a cost of `0`)
6969
- For each type in the operation, the `typeCost` function is called with the type. (By default

0 commit comments

Comments
 (0)