diff --git a/.changeset/big-pig-helps.md b/.changeset/big-pig-helps.md deleted file mode 100644 index a39d9485b..000000000 --- a/.changeset/big-pig-helps.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -'@graphql-hive/core': minor -'@graphql-hive/apollo': minor -'@graphql-hive/envelop': minor -'@graphql-hive/yoga': minor ---- - -Add support for providing a logger object via `HivePluginOptions`. - -It is possible to provide the following options: - -- **'trace'** -- **'debug'** -- **'info'** default -- **'warn'** -- **'error'** - -```ts -import { createHive } from '@graphql-hive/core' - -const client = createHive({ - logger: 'info' -}) -``` - -In addition to that, it is also possible to provide a Hive Logger instance, that allows more control over how you want to log and forward logs. - -```ts -import { createHive } from '@graphql-hive/core' -import { Logger } from '@graphql-hive/logger' - -const client = createHive({ - logger: new Logger() -}) -``` - -Head to our [Hive Logger documentation](https://the-guild.dev/graphql/hive/docs/logger) to learn more. - -___ - -**The `HivePluginOptions.debug` option is now deprecated.** Instead, please use the `logger` option to control logging levels. - -```diff - import { createHive } from '@graphql-hive/core' - - const client = createHive({ -- debug: process.env.DEBUG === "1", -+ logger: process.env.DEBUG === "1" ? "debug" : "info", - }) -``` - -**Note**: If the `logger` property is provided, the `debug` option is ignored. - -___ - -**The `HivePluginOptions.agent.logger` option is now deprecated.** Instead, please provide -`HivePluginOptions.logger`. - -```diff - import { createHive } from '@graphql-hive/core' - - const logger = new Logger() - - const client = createHive({ - agent: { -- logger, - }, -+ logger, - }) -``` - -**Note**: If both options are provided, the `agent` option is ignored. diff --git a/.changeset/brave-falcons-glow.md b/.changeset/brave-falcons-glow.md deleted file mode 100644 index 1688b33bb..000000000 --- a/.changeset/brave-falcons-glow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'hive': patch ---- - -Expose `Project.createdAt` field via the public GraphQL API. diff --git a/.changeset/brave-tigers-dance.md b/.changeset/brave-tigers-dance.md deleted file mode 100644 index 1ad5ec98c..000000000 --- a/.changeset/brave-tigers-dance.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-hive/cli': patch ---- - -Fixes an issue where schema changes containing escaped single-quoted strings were not handled correctly. diff --git a/.changeset/calm-mails-sneeze.md b/.changeset/calm-mails-sneeze.md deleted file mode 100644 index 838aeeee0..000000000 --- a/.changeset/calm-mails-sneeze.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -'@graphql-hive/core': minor -'@graphql-hive/apollo': minor -'@graphql-hive/yoga': minor ---- - -**Persisted Documents Improvements** - -Persisted documents now support specifying a mirror endpoint that will be used in case the main CDN -is unreachable. Provide an array of endpoints to the client configuration. - -```ts -import { createClient } from '@graphql-hive/core' - -const client = createClient({ - experimental__persistedDocuments: { - cdn: { - endpoint: [ - 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688', - 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688' - ], - accessToken: '' - } - } -}) -``` - -In addition to that, the underlying logic for looking up documents now uses a circuit breaker. If a -single endpoint is unreachable, further lookups on that endpoint are skipped. - -The behaviour of the circuit breaker can be customized via the `circuitBreaker` configuration. - -```ts -import { createClient } from '@graphql-hive/core' - -const client = createClient({ - experimental__persistedDocuments: { - cdn: { - endpoint: [ - 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688', - 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688' - ], - accessToken: '' - }, - circuitBreaker: { - // open circuit if 50 percent of request result in an error - errorThresholdPercentage: 50, - // start monitoring the circuit after 10 requests - volumeThreshold: 10, - // time before the backend is tried again after the circuit is open - resetTimeout: 30_000 - } - } -}) -``` diff --git a/.changeset/loose-dots-learn.md b/.changeset/loose-dots-learn.md deleted file mode 100644 index a3b346da3..000000000 --- a/.changeset/loose-dots-learn.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@graphql-hive/cli': minor -'hive': minor ---- - -Upgrade graphql-inspector/core to v7 and update the models to be able to handle the new change -objects. GraphQL Inspector now supports directive changes and improves the accuracy of the severity level for several change types. This will improve schema checks to make them more accurate and more complete. See graphql-inspector's changelog for details. diff --git a/.changeset/nine-worlds-slide.md b/.changeset/nine-worlds-slide.md deleted file mode 100644 index 98fde7a6a..000000000 --- a/.changeset/nine-worlds-slide.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -'@graphql-hive/apollo': minor ---- - -**Supergraph Manager Improvements** - -Persisted documents now support specifying a mirror endpoint that will be used in case the main CDN -is unreachable. Provide an array of endpoints to the supergraph manager configuration. - -```ts -import { createSupergraphManager } from '@graphql-hive/apollo' - -const supergraphManager = createSupergraphManager({ - endpoint: [ - 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688/supergraph', - 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688/supergraph' - ], - key: '' -}) -``` - -In addition to that, the underlying logic for looking up documents now uses a circuit breaker. If a -single endpoint is unreachable, further lookups on that endpoint are skipped. - -```ts -import { createSupergraphManager } from '@graphql-hive/apollo' - -const supergraphManager = createSupergraphManager({ - endpoint: [ - 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688/supergraph', - 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688/supergraph' - ], - key: '', - circuitBreaker: { - // open circuit if 50 percent of request result in an error - errorThresholdPercentage: 50, - // start monitoring the circuit after 10 requests - volumeThreshold: 10, - // time before the backend is tried again after the circuit is open - resetTimeout: 30_000 - } -}) -``` diff --git a/.changeset/upset-lemons-reply.md b/.changeset/upset-lemons-reply.md deleted file mode 100644 index 260fe88eb..000000000 --- a/.changeset/upset-lemons-reply.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -'@graphql-hive/core': minor ---- - -**New CDN Artifact Fetcher** - -We have a new interface for fetching CDN artifacts (such as supergraph and services) with a cache -from the CDN. This fetcher supports providing a mirror endpoint and comes with a circuit breaker -under the hood. - -```ts -const supergraphFetcher = createCDNArtifactFetcher({ - endpoint: [ - 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688', - 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688' - ], - accessKey: '' -}) - -supergraphFetcher.fetch() -``` - ---- - -`createSupergraphSDLFetcher` is now deprecated. Please upgrade to use `createCDNArtifactFetcher`. diff --git a/deployment/CHANGELOG.md b/deployment/CHANGELOG.md index 699521444..81b4091dd 100644 --- a/deployment/CHANGELOG.md +++ b/deployment/CHANGELOG.md @@ -1,5 +1,24 @@ # hive +## 8.12.0 + +### Minor Changes + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - Upgrade graphql-inspector/core to v7 and update the + models to be able to handle the new change objects. GraphQL Inspector now supports directive + changes and improves the accuracy of the severity level for several change types. This will + improve schema checks to make them more accurate and more complete. See graphql-inspector's + changelog for details. + +### Patch Changes + +- [#7328](https://github.com/graphql-hive/console/pull/7328) + [`c024ea7`](https://github.com/graphql-hive/console/commit/c024ea7666ee96517b34286d8da35ef20ed89044) + Thanks [@adambenhassen](https://github.com/adambenhassen)! - Expose `Project.createdAt` field via + the public GraphQL API. + ## 8.11.0 ### Minor Changes diff --git a/deployment/package.json b/deployment/package.json index 0d5f856bb..afe61e492 100644 --- a/deployment/package.json +++ b/deployment/package.json @@ -1,6 +1,6 @@ { "name": "hive", - "version": "8.11.0", + "version": "8.12.0", "private": true, "scripts": { "generate": "tsx generate.ts", diff --git a/packages/libraries/apollo/CHANGELOG.md b/packages/libraries/apollo/CHANGELOG.md index a7d36994f..010c6a9d8 100644 --- a/packages/libraries/apollo/CHANGELOG.md +++ b/packages/libraries/apollo/CHANGELOG.md @@ -1,5 +1,183 @@ # @graphql-hive/apollo +## 0.45.0 + +### Minor Changes + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - Add support for providing a logger object via + `HivePluginOptions`. + + It is possible to provide the following options: + + - **'trace'** + - **'debug'** + - **'info'** default + - **'warn'** + - **'error'** + + ```ts + import { createHive } from '@graphql-hive/core' + + const client = createHive({ + logger: 'info' + }) + ``` + + In addition to that, it is also possible to provide a Hive Logger instance, that allows more + control over how you want to log and forward logs. + + ```ts + import { createHive } from '@graphql-hive/core' + import { Logger } from '@graphql-hive/logger' + + const client = createHive({ + logger: new Logger() + }) + ``` + + Head to our [Hive Logger documentation](https://the-guild.dev/graphql/hive/docs/logger) to learn + more. + + *** + + **The `HivePluginOptions.debug` option is now deprecated.** Instead, please use the `logger` + option to control logging levels. + + ```diff + import { createHive } from '@graphql-hive/core' + + const client = createHive({ + - debug: process.env.DEBUG === "1", + + logger: process.env.DEBUG === "1" ? "debug" : "info", + }) + ``` + + **Note**: If the `logger` property is provided, the `debug` option is ignored. + + *** + + **The `HivePluginOptions.agent.logger` option is now deprecated.** Instead, please provide + `HivePluginOptions.logger`. + + ```diff + import { createHive } from '@graphql-hive/core' + + const logger = new Logger() + + const client = createHive({ + agent: { + - logger, + }, + + logger, + }) + ``` + + **Note**: If both options are provided, the `agent` option is ignored. + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - **Persisted Documents Improvements** + + Persisted documents now support specifying a mirror endpoint that will be used in case the main + CDN is unreachable. Provide an array of endpoints to the client configuration. + + ```ts + import { createClient } from '@graphql-hive/core' + + const client = createClient({ + experimental__persistedDocuments: { + cdn: { + endpoint: [ + 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688', + 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688' + ], + accessToken: '' + } + } + }) + ``` + + In addition to that, the underlying logic for looking up documents now uses a circuit breaker. If + a single endpoint is unreachable, further lookups on that endpoint are skipped. + + The behaviour of the circuit breaker can be customized via the `circuitBreaker` configuration. + + ```ts + import { createClient } from '@graphql-hive/core' + + const client = createClient({ + experimental__persistedDocuments: { + cdn: { + endpoint: [ + 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688', + 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688' + ], + accessToken: '' + }, + circuitBreaker: { + // open circuit if 50 percent of request result in an error + errorThresholdPercentage: 50, + // start monitoring the circuit after 10 requests + volumeThreshold: 10, + // time before the backend is tried again after the circuit is open + resetTimeout: 30_000 + } + } + }) + ``` + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - **Supergraph Manager Improvements** + + Persisted documents now support specifying a mirror endpoint that will be used in case the main + CDN is unreachable. Provide an array of endpoints to the supergraph manager configuration. + + ```ts + import { createSupergraphManager } from '@graphql-hive/apollo' + + const supergraphManager = createSupergraphManager({ + endpoint: [ + 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688/supergraph', + 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688/supergraph' + ], + key: '' + }) + ``` + + In addition to that, the underlying logic for looking up documents now uses a circuit breaker. If + a single endpoint is unreachable, further lookups on that endpoint are skipped. + + ```ts + import { createSupergraphManager } from '@graphql-hive/apollo' + + const supergraphManager = createSupergraphManager({ + endpoint: [ + 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688/supergraph', + 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688/supergraph' + ], + key: '', + circuitBreaker: { + // open circuit if 50 percent of request result in an error + errorThresholdPercentage: 50, + // start monitoring the circuit after 10 requests + volumeThreshold: 10, + // time before the backend is tried again after the circuit is open + resetTimeout: 30_000 + } + }) + ``` + +### Patch Changes + +- Updated dependencies + [[`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d), + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d), + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d)]: + - @graphql-hive/core@0.18.0 + ## 0.42.1 ### Patch Changes diff --git a/packages/libraries/apollo/package.json b/packages/libraries/apollo/package.json index 25c632ab9..3359cb80e 100644 --- a/packages/libraries/apollo/package.json +++ b/packages/libraries/apollo/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-hive/apollo", - "version": "0.44.0", + "version": "0.45.0", "type": "module", "description": "GraphQL Hive + Apollo Server", "repository": { diff --git a/packages/libraries/apollo/src/version.ts b/packages/libraries/apollo/src/version.ts index a89e3c372..fbc6b5741 100644 --- a/packages/libraries/apollo/src/version.ts +++ b/packages/libraries/apollo/src/version.ts @@ -1 +1 @@ -export const version = '0.44.0'; +export const version = '0.45.0'; diff --git a/packages/libraries/cli/CHANGELOG.md b/packages/libraries/cli/CHANGELOG.md index 45fd636f4..922fe187c 100644 --- a/packages/libraries/cli/CHANGELOG.md +++ b/packages/libraries/cli/CHANGELOG.md @@ -1,5 +1,30 @@ # @graphql-hive/cli +## 0.56.0 + +### Minor Changes + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - Upgrade graphql-inspector/core to v7 and update the + models to be able to handle the new change objects. GraphQL Inspector now supports directive + changes and improves the accuracy of the severity level for several change types. This will + improve schema checks to make them more accurate and more complete. See graphql-inspector's + changelog for details. + +### Patch Changes + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - Fixes an issue where schema changes containing + escaped single-quoted strings were not handled correctly. + +- Updated dependencies + [[`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d), + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d), + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d)]: + - @graphql-hive/core@0.18.0 + ## 0.55.1 ### Patch Changes diff --git a/packages/libraries/cli/README.md b/packages/libraries/cli/README.md index 39a543f5f..39748d19f 100644 --- a/packages/libraries/cli/README.md +++ b/packages/libraries/cli/README.md @@ -81,7 +81,7 @@ DESCRIPTION ``` _See code: -[src/commands/app/create.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/app/create.ts)_ +[src/commands/app/create.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/app/create.ts)_ ## `hive app:publish` @@ -108,7 +108,7 @@ DESCRIPTION ``` _See code: -[src/commands/app/publish.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/app/publish.ts)_ +[src/commands/app/publish.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/app/publish.ts)_ ## `hive app:retire` @@ -135,7 +135,7 @@ DESCRIPTION ``` _See code: -[src/commands/app/retire.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/app/retire.ts)_ +[src/commands/app/retire.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/app/retire.ts)_ ## `hive artifact:fetch` @@ -159,7 +159,7 @@ DESCRIPTION ``` _See code: -[src/commands/artifact/fetch.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/artifact/fetch.ts)_ +[src/commands/artifact/fetch.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/artifact/fetch.ts)_ ## `hive dev` @@ -202,7 +202,7 @@ DESCRIPTION ``` _See code: -[src/commands/dev.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/dev.ts)_ +[src/commands/dev.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/dev.ts)_ ## `hive help [COMMAND]` @@ -246,7 +246,7 @@ DESCRIPTION ``` _See code: -[src/commands/introspect.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/introspect.ts)_ +[src/commands/introspect.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/introspect.ts)_ ## `hive operations:check FILE` @@ -305,7 +305,7 @@ DESCRIPTION ``` _See code: -[src/commands/operations/check.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/operations/check.ts)_ +[src/commands/operations/check.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/operations/check.ts)_ ## `hive schema:check FILE` @@ -349,7 +349,7 @@ DESCRIPTION ``` _See code: -[src/commands/schema/check.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/schema/check.ts)_ +[src/commands/schema/check.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/schema/check.ts)_ ## `hive schema:delete SERVICE` @@ -381,7 +381,7 @@ DESCRIPTION ``` _See code: -[src/commands/schema/delete.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/schema/delete.ts)_ +[src/commands/schema/delete.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/schema/delete.ts)_ ## `hive schema:fetch [COMMIT]` @@ -414,7 +414,7 @@ DESCRIPTION ``` _See code: -[src/commands/schema/fetch.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/schema/fetch.ts)_ +[src/commands/schema/fetch.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/schema/fetch.ts)_ ## `hive schema:publish FILE` @@ -458,7 +458,7 @@ DESCRIPTION ``` _See code: -[src/commands/schema/publish.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/schema/publish.ts)_ +[src/commands/schema/publish.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/schema/publish.ts)_ ## `hive update [CHANNEL]` @@ -520,7 +520,7 @@ DESCRIPTION ``` _See code: -[src/commands/whoami.ts](https://github.com/graphql-hive/platform/blob/v0.55.1/src/commands/whoami.ts)_ +[src/commands/whoami.ts](https://github.com/graphql-hive/platform/blob/v0.56.0/src/commands/whoami.ts)_ diff --git a/packages/libraries/cli/package.json b/packages/libraries/cli/package.json index a3a37d0af..0391f65f7 100644 --- a/packages/libraries/cli/package.json +++ b/packages/libraries/cli/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-hive/cli", - "version": "0.55.1", + "version": "0.56.0", "description": "A CLI util to manage and control your GraphQL Hive", "repository": { "type": "git", diff --git a/packages/libraries/core/CHANGELOG.md b/packages/libraries/core/CHANGELOG.md index b1e7cab0d..bc75d725c 100644 --- a/packages/libraries/core/CHANGELOG.md +++ b/packages/libraries/core/CHANGELOG.md @@ -1,5 +1,157 @@ # @graphql-hive/core +## 0.18.0 + +### Minor Changes + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - Add support for providing a logger object via + `HivePluginOptions`. + + It is possible to provide the following options: + + - **'trace'** + - **'debug'** + - **'info'** default + - **'warn'** + - **'error'** + + ```ts + import { createHive } from '@graphql-hive/core' + + const client = createHive({ + logger: 'info' + }) + ``` + + In addition to that, it is also possible to provide a Hive Logger instance, that allows more + control over how you want to log and forward logs. + + ```ts + import { createHive } from '@graphql-hive/core' + import { Logger } from '@graphql-hive/logger' + + const client = createHive({ + logger: new Logger() + }) + ``` + + Head to our [Hive Logger documentation](https://the-guild.dev/graphql/hive/docs/logger) to learn + more. + + *** + + **The `HivePluginOptions.debug` option is now deprecated.** Instead, please use the `logger` + option to control logging levels. + + ```diff + import { createHive } from '@graphql-hive/core' + + const client = createHive({ + - debug: process.env.DEBUG === "1", + + logger: process.env.DEBUG === "1" ? "debug" : "info", + }) + ``` + + **Note**: If the `logger` property is provided, the `debug` option is ignored. + + *** + + **The `HivePluginOptions.agent.logger` option is now deprecated.** Instead, please provide + `HivePluginOptions.logger`. + + ```diff + import { createHive } from '@graphql-hive/core' + + const logger = new Logger() + + const client = createHive({ + agent: { + - logger, + }, + + logger, + }) + ``` + + **Note**: If both options are provided, the `agent` option is ignored. + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - **Persisted Documents Improvements** + + Persisted documents now support specifying a mirror endpoint that will be used in case the main + CDN is unreachable. Provide an array of endpoints to the client configuration. + + ```ts + import { createClient } from '@graphql-hive/core' + + const client = createClient({ + experimental__persistedDocuments: { + cdn: { + endpoint: [ + 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688', + 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688' + ], + accessToken: '' + } + } + }) + ``` + + In addition to that, the underlying logic for looking up documents now uses a circuit breaker. If + a single endpoint is unreachable, further lookups on that endpoint are skipped. + + The behaviour of the circuit breaker can be customized via the `circuitBreaker` configuration. + + ```ts + import { createClient } from '@graphql-hive/core' + + const client = createClient({ + experimental__persistedDocuments: { + cdn: { + endpoint: [ + 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688', + 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688' + ], + accessToken: '' + }, + circuitBreaker: { + // open circuit if 50 percent of request result in an error + errorThresholdPercentage: 50, + // start monitoring the circuit after 10 requests + volumeThreshold: 10, + // time before the backend is tried again after the circuit is open + resetTimeout: 30_000 + } + } + }) + ``` + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - **New CDN Artifact Fetcher** + + We have a new interface for fetching CDN artifacts (such as supergraph and services) with a cache + from the CDN. This fetcher supports providing a mirror endpoint and comes with a circuit breaker + under the hood. + + ```ts + const supergraphFetcher = createCDNArtifactFetcher({ + endpoint: [ + 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688', + 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688' + ], + accessKey: '' + }) + + supergraphFetcher.fetch() + ``` + + *** + + `createSupergraphSDLFetcher` is now deprecated. Please upgrade to use `createCDNArtifactFetcher`. + ## 0.15.1 ### Patch Changes diff --git a/packages/libraries/core/package.json b/packages/libraries/core/package.json index fa87d4f5d..4aa6b3710 100644 --- a/packages/libraries/core/package.json +++ b/packages/libraries/core/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-hive/core", - "version": "0.17.0", + "version": "0.18.0", "type": "module", "repository": { "type": "git", diff --git a/packages/libraries/core/src/version.ts b/packages/libraries/core/src/version.ts index 2c3072cd9..0aa658f33 100644 --- a/packages/libraries/core/src/version.ts +++ b/packages/libraries/core/src/version.ts @@ -1 +1 @@ -export const version = '0.17.0'; +export const version = '0.18.0'; diff --git a/packages/libraries/envelop/CHANGELOG.md b/packages/libraries/envelop/CHANGELOG.md index 92733b07c..ff808d331 100644 --- a/packages/libraries/envelop/CHANGELOG.md +++ b/packages/libraries/envelop/CHANGELOG.md @@ -1,5 +1,89 @@ # @graphql-hive/envelop +## 0.40.0 + +### Minor Changes + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - Add support for providing a logger object via + `HivePluginOptions`. + + It is possible to provide the following options: + + - **'trace'** + - **'debug'** + - **'info'** default + - **'warn'** + - **'error'** + + ```ts + import { createHive } from '@graphql-hive/core' + + const client = createHive({ + logger: 'info' + }) + ``` + + In addition to that, it is also possible to provide a Hive Logger instance, that allows more + control over how you want to log and forward logs. + + ```ts + import { createHive } from '@graphql-hive/core' + import { Logger } from '@graphql-hive/logger' + + const client = createHive({ + logger: new Logger() + }) + ``` + + Head to our [Hive Logger documentation](https://the-guild.dev/graphql/hive/docs/logger) to learn + more. + + *** + + **The `HivePluginOptions.debug` option is now deprecated.** Instead, please use the `logger` + option to control logging levels. + + ```diff + import { createHive } from '@graphql-hive/core' + + const client = createHive({ + - debug: process.env.DEBUG === "1", + + logger: process.env.DEBUG === "1" ? "debug" : "info", + }) + ``` + + **Note**: If the `logger` property is provided, the `debug` option is ignored. + + *** + + **The `HivePluginOptions.agent.logger` option is now deprecated.** Instead, please provide + `HivePluginOptions.logger`. + + ```diff + import { createHive } from '@graphql-hive/core' + + const logger = new Logger() + + const client = createHive({ + agent: { + - logger, + }, + + logger, + }) + ``` + + **Note**: If both options are provided, the `agent` option is ignored. + +### Patch Changes + +- Updated dependencies + [[`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d), + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d), + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d)]: + - @graphql-hive/core@0.18.0 + ## 0.38.1 ### Patch Changes diff --git a/packages/libraries/envelop/package.json b/packages/libraries/envelop/package.json index 2b719d573..47901495a 100644 --- a/packages/libraries/envelop/package.json +++ b/packages/libraries/envelop/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-hive/envelop", - "version": "0.39.1", + "version": "0.40.0", "type": "module", "description": "GraphQL Hive + GraphQL Envelop", "repository": { diff --git a/packages/libraries/envelop/src/version.ts b/packages/libraries/envelop/src/version.ts index 13dc8be48..699403817 100644 --- a/packages/libraries/envelop/src/version.ts +++ b/packages/libraries/envelop/src/version.ts @@ -1 +1 @@ -export const version = '0.39.1'; +export const version = '0.40.0'; diff --git a/packages/libraries/yoga/CHANGELOG.md b/packages/libraries/yoga/CHANGELOG.md index 9c8323ae9..98e62e6b6 100644 --- a/packages/libraries/yoga/CHANGELOG.md +++ b/packages/libraries/yoga/CHANGELOG.md @@ -1,5 +1,141 @@ # @graphql-hive/yoga +## 0.46.0 + +### Minor Changes + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - Add support for providing a logger object via + `HivePluginOptions`. + + It is possible to provide the following options: + + - **'trace'** + - **'debug'** + - **'info'** default + - **'warn'** + - **'error'** + + ```ts + import { createHive } from '@graphql-hive/core' + + const client = createHive({ + logger: 'info' + }) + ``` + + In addition to that, it is also possible to provide a Hive Logger instance, that allows more + control over how you want to log and forward logs. + + ```ts + import { createHive } from '@graphql-hive/core' + import { Logger } from '@graphql-hive/logger' + + const client = createHive({ + logger: new Logger() + }) + ``` + + Head to our [Hive Logger documentation](https://the-guild.dev/graphql/hive/docs/logger) to learn + more. + + *** + + **The `HivePluginOptions.debug` option is now deprecated.** Instead, please use the `logger` + option to control logging levels. + + ```diff + import { createHive } from '@graphql-hive/core' + + const client = createHive({ + - debug: process.env.DEBUG === "1", + + logger: process.env.DEBUG === "1" ? "debug" : "info", + }) + ``` + + **Note**: If the `logger` property is provided, the `debug` option is ignored. + + *** + + **The `HivePluginOptions.agent.logger` option is now deprecated.** Instead, please provide + `HivePluginOptions.logger`. + + ```diff + import { createHive } from '@graphql-hive/core' + + const logger = new Logger() + + const client = createHive({ + agent: { + - logger, + }, + + logger, + }) + ``` + + **Note**: If both options are provided, the `agent` option is ignored. + +- [#7346](https://github.com/graphql-hive/console/pull/7346) + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - **Persisted Documents Improvements** + + Persisted documents now support specifying a mirror endpoint that will be used in case the main + CDN is unreachable. Provide an array of endpoints to the client configuration. + + ```ts + import { createClient } from '@graphql-hive/core' + + const client = createClient({ + experimental__persistedDocuments: { + cdn: { + endpoint: [ + 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688', + 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688' + ], + accessToken: '' + } + } + }) + ``` + + In addition to that, the underlying logic for looking up documents now uses a circuit breaker. If + a single endpoint is unreachable, further lookups on that endpoint are skipped. + + The behaviour of the circuit breaker can be customized via the `circuitBreaker` configuration. + + ```ts + import { createClient } from '@graphql-hive/core' + + const client = createClient({ + experimental__persistedDocuments: { + cdn: { + endpoint: [ + 'https://cdn.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688', + 'https://cdn-mirror.graphql-hive.com/artifacts/v1/9fb37bc4-e520-4019-843a-0c8698c25688' + ], + accessToken: '' + }, + circuitBreaker: { + // open circuit if 50 percent of request result in an error + errorThresholdPercentage: 50, + // start monitoring the circuit after 10 requests + volumeThreshold: 10, + // time before the backend is tried again after the circuit is open + resetTimeout: 30_000 + } + } + }) + ``` + +### Patch Changes + +- Updated dependencies + [[`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d), + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d), + [`f266368`](https://github.com/graphql-hive/console/commit/f26636891b8b7e00b9a7823e9d584cedd9dd0f2d)]: + - @graphql-hive/core@0.18.0 + ## 0.43.1 ### Patch Changes diff --git a/packages/libraries/yoga/package.json b/packages/libraries/yoga/package.json index 99996639b..c2229cd3e 100644 --- a/packages/libraries/yoga/package.json +++ b/packages/libraries/yoga/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-hive/yoga", - "version": "0.45.0", + "version": "0.46.0", "type": "module", "description": "GraphQL Hive + GraphQL Yoga", "repository": { diff --git a/packages/libraries/yoga/src/version.ts b/packages/libraries/yoga/src/version.ts index fbc6b5741..b1c7d2f8f 100644 --- a/packages/libraries/yoga/src/version.ts +++ b/packages/libraries/yoga/src/version.ts @@ -1 +1 @@ -export const version = '0.45.0'; +export const version = '0.46.0';