Skip to content

Commit

Permalink
fix(deps): update dependency parse-duration to v2 (#539)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: theguild-bot <[email protected]>
Co-authored-by: Arda TANRIKULU <[email protected]>
  • Loading branch information
4 people authored Jan 27, 2025
1 parent aab5441 commit df20361
Show file tree
Hide file tree
Showing 20 changed files with 36 additions and 35 deletions.
7 changes: 7 additions & 0 deletions .changeset/@graphql-hive_gateway-539-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@graphql-hive/gateway': patch
---

dependencies updates:

- Updated dependency [`parse-duration@^2.0.0` ↗︎](https://www.npmjs.com/package/parse-duration/v/2.0.0) (from `^1.1.0`, in `dependencies`)
Binary file modified examples/extra-fields/example.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/extra-fields/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified examples/hmac-auth-https/example.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/hmac-auth-https/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified examples/interface-additional-resolvers/example.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/interface-additional-resolvers/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified examples/subscriptions-with-transforms/example.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/subscriptions-with-transforms/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified examples/type-merging-batching/example.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/type-merging-batching/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"dotenv": "^16.3.1",
"graphql-ws": "^5.16.0",
"graphql-yoga": "^5.10.11",
"parse-duration": "^1.1.0",
"parse-duration": "^2.0.0",
"tslib": "^2.8.1",
"ws": "^8.18.0"
},
Expand Down
28 changes: 14 additions & 14 deletions packages/gateway/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const defaultOptions = {
? '127.0.0.1'
: '0.0.0.0',
port: 4000,
polling: '10s',
pollingInterval: 10_000,
};

/** Root cli for the gateway. */
Expand All @@ -213,9 +213,10 @@ let cli = new Command()
.addOption(
new Option(
'--fork <count>',
`count of workers to spawn. uses "${maxFork}" (available parallelism) workers when NODE_ENV is "production", otherwise "1" (the main) worker (default: ${JSON.stringify(defaultOptions.fork)}`,
`count of workers to spawn. uses "${maxFork}" (available parallelism) workers when NODE_ENV is "production", otherwise "1" (the main) worker`,
)
.env('FORK')
.default(defaultOptions.fork)
.argParser((v) => {
const count = parseInt(v);
if (isNaN(count)) {
Expand All @@ -235,17 +236,16 @@ let cli = new Command()
`path to the configuration file. defaults to the following files respectively in the current working directory: ${createDefaultConfigPaths('gateway').join(', ')}`,
).env('CONFIG_PATH'),
)
.option(
'-h, --host <hostname>',
`host to use for serving (default: ${JSON.stringify(defaultOptions.host)}`,
defaultOptions.host,
.addOption(
new Option('-h, --host <hostname>', `host to use for serving`).default(
defaultOptions.host,
defaultOptions.host,
),
)
.addOption(
new Option(
'-p, --port <number>',
`port to use for serving (default: ${JSON.stringify(defaultOptions.port)}`,
)
new Option('-p, --port <number>', `port to use for serving`)
.env('PORT')
.default(defaultOptions.port)
.argParser((v) => {
const port = parseInt(v);
if (isNaN(port)) {
Expand All @@ -256,13 +256,13 @@ let cli = new Command()
)
.addOption(
new Option(
'--polling <duration>',
`schema polling interval in human readable duration (default: ${JSON.stringify(defaultOptions.polling)})`,
'--polling, --pollingInterval <duration>',
`schema polling interval in human readable duration`,
)
.default(parseDuration(defaultOptions.polling))
.default(10_000, '10s')
.env('POLLING')
.argParser((v) => {
const interval = parseDuration(v);
const interval = parseDuration(v) as number;
if (!interval) {
throw new InvalidArgumentError('not a duration.');
}
Expand Down
2 changes: 0 additions & 2 deletions packages/gateway/src/commands/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const addCommand: AddCommand = (ctx, cli) =>
hiveCdnKey,
hiveRegistryToken,
maskedErrors,
polling,
hivePersistedDocumentsEndpoint,
hivePersistedDocumentsToken,
...opts
Expand Down Expand Up @@ -123,7 +122,6 @@ export const addCommand: AddCommand = (ctx, cli) =>
},
}
: {}),
...(polling ? { pollingInterval: polling } : {}),
proxy,
...(schema ? { schema } : {}),
logging: loadedConfig.logging ?? ctx.log,
Expand Down
2 changes: 0 additions & 2 deletions packages/gateway/src/commands/subgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export const addCommand: AddCommand = (ctx, cli) =>
const {
maskedErrors,
hiveRegistryToken,
polling,
hivePersistedDocumentsEndpoint,
hivePersistedDocumentsToken,
...opts
Expand Down Expand Up @@ -84,7 +83,6 @@ export const addCommand: AddCommand = (ctx, cli) =>
},
}
: {}),
...(polling ? { pollingInterval: polling } : {}),
subgraph,
logging: loadedConfig.logging ?? ctx.log,
productName: ctx.productName,
Expand Down
2 changes: 0 additions & 2 deletions packages/gateway/src/commands/supergraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const addCommand: AddCommand = (ctx, cli) =>
hiveCdnKey,
hiveRegistryToken,
maskedErrors,
polling,
apolloGraphRef,
apolloKey,
hivePersistedDocumentsEndpoint,
Expand Down Expand Up @@ -200,7 +199,6 @@ export const addCommand: AddCommand = (ctx, cli) =>
...loadedConfig,
...opts,
...registryConfig,
...(polling ? { pollingInterval: polling } : {}),
supergraph,
logging: loadedConfig.logging ?? ctx.log,
productName: ctx.productName,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/hmac-upstream-signature/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"tslib": "^2.8.1"
},
"devDependencies": {
"@graphql-hive/gateway": "workspace:*",
"@graphql-hive/gateway-runtime": "workspace:*",
"@types/json-stable-stringify": "^1.1.0",
"graphql": "^16.9.0",
"graphql-yoga": "^5.10.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/hmac-upstream-signature/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { GatewayPlugin } from '@graphql-hive/gateway';
import type { GatewayPlugin } from '@graphql-hive/gateway-runtime';
import type { OnSubgraphExecutePayload } from '@graphql-mesh/fusion-runtime';
import { serializeExecutionRequest } from '@graphql-tools/executor-common';
import { mapMaybePromise } from '@graphql-tools/utils';
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/tests/graphos.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
DefaultLogger,
type GatewayConfigContext,
type GatewayGraphOSManagedFederationOptions,
} from '@graphql-hive/gateway';
} from '@graphql-hive/gateway-runtime';
import { Response } from '@whatwg-node/fetch';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { createGraphOSFetcher } from '../src/fetchers/graphos';
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3299,7 +3299,7 @@ __metadata:
graphql-middleware: "npm:^6.1.35"
graphql-ws: "npm:^5.16.0"
graphql-yoga: "npm:^5.10.11"
parse-duration: "npm:^1.1.0"
parse-duration: "npm:^2.0.0"
pkgroll: "npm:2.6.1"
postject: "npm:^1.0.0-alpha.6"
rimraf: "npm:^6.0.1"
Expand Down Expand Up @@ -3507,7 +3507,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@graphql-mesh/hmac-upstream-signature@workspace:packages/plugins/hmac-upstream-signature"
dependencies:
"@graphql-hive/gateway": "workspace:*"
"@graphql-hive/gateway-runtime": "workspace:*"
"@graphql-mesh/cross-helpers": "npm:^0.4.9"
"@graphql-mesh/types": "npm:^0.103.6"
"@graphql-mesh/utils": "npm:^0.103.6"
Expand Down Expand Up @@ -14364,10 +14364,10 @@ __metadata:
languageName: node
linkType: hard

"parse-duration@npm:^1.1.0":
version: 1.1.2
resolution: "parse-duration@npm:1.1.2"
checksum: 10c0/2e014150ecfa4a509028a6122b045bda5c1e0c367ca5eae854cdb91cf2a9ce763bb4ae551cecffda19330316976f699a71f6c125c26e6cacbc02fced812316ab
"parse-duration@npm:^2.0.0":
version: 2.0.1
resolution: "parse-duration@npm:2.0.1"
checksum: 10c0/8629786dbefd20603daddca03af9ac383cf5220e2728c616bb3a51aa60a64c8bfb2ef9603ccb4805642447c7f788334003a54226e39fedd9ca09acdf0321c8e8
languageName: node
linkType: hard

Expand Down

0 comments on commit df20361

Please sign in to comment.