@graphql-hive/yoga 0.44.0-alpha-20251124105143-3687098f1316893d86a181b7e3b7aa12704b90cb → 0.44.0-alpha-20251125121050-94b0fd960a0afb15a2a04e903a711c75cb6020a2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -6,6 +6,7 @@ exports.useHive = useHive;
6
6
  const graphql_1 = require("graphql");
7
7
  const graphql_yoga_1 = require("graphql-yoga");
8
8
  const core_1 = require("@graphql-hive/core");
9
+ const logger_1 = require("@graphql-hive/logger");
9
10
  const plugin_persisted_operations_1 = require("@graphql-yoga/plugin-persisted-operations");
10
11
  const version_js_1 = require("./version.js");
11
12
  var core_2 = require("@graphql-hive/core");
@@ -120,14 +121,20 @@ function useHive(clientOrOptions) {
120
121
  }
121
122
  },
122
123
  onPluginInit({ addPlugin }) {
124
+ var _a;
123
125
  hive = (0, core_1.isHiveClient)(clientOrOptions)
124
126
  ? clientOrOptions
125
- : createHive(Object.assign(Object.assign({}, clientOrOptions), { agent: clientOrOptions.agent
126
- ? Object.assign({ logger: {
127
- // Hive Plugin should respect the given Yoga logger
128
- error: (...args) => yoga.logger.error(...args),
129
- info: (...args) => yoga.logger.info(...args),
130
- },
127
+ : createHive(Object.assign(Object.assign({}, clientOrOptions), { logger: (_a = clientOrOptions.logger) !== null && _a !== void 0 ? _a : new logger_1.Logger({
128
+ writers: [
129
+ {
130
+ write(level, attrs, msg) {
131
+ level = level === 'trace' ? 'debug' : level;
132
+ yoga.logger[level](msg, attrs);
133
+ },
134
+ },
135
+ ],
136
+ }), agent: clientOrOptions.agent
137
+ ? Object.assign({
131
138
  // Hive Plugin should respect the given FetchAPI, note that this is not `yoga.fetch`
132
139
  fetch: (...args) => yoga.fetchAPI.fetch(...args) }, clientOrOptions.agent) : undefined }));
133
140
  void hive.info();
package/cjs/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = '0.44.0-alpha-20251124105143-3687098f1316893d86a181b7e3b7aa12704b90cb';
4
+ exports.version = '0.44.0-alpha-20251125121050-94b0fd960a0afb15a2a04e903a711c75cb6020a2';
package/esm/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { GraphQLError, Kind, parse } from 'graphql';
2
2
  import { _createLRUCache } from 'graphql-yoga';
3
3
  import { autoDisposeSymbol, createHive as createHiveClient, isAsyncIterable, isHiveClient, } from '@graphql-hive/core';
4
+ import { Logger } from '@graphql-hive/logger';
4
5
  import { usePersistedOperations } from '@graphql-yoga/plugin-persisted-operations';
5
6
  import { version } from './version.js';
6
7
  export { atLeastOnceSampler, createSchemaFetcher, createServicesFetcher, createSupergraphSDLFetcher, } from '@graphql-hive/core';
@@ -111,14 +112,20 @@ export function useHive(clientOrOptions) {
111
112
  }
112
113
  },
113
114
  onPluginInit({ addPlugin }) {
115
+ var _a;
114
116
  hive = isHiveClient(clientOrOptions)
115
117
  ? clientOrOptions
116
- : createHive(Object.assign(Object.assign({}, clientOrOptions), { agent: clientOrOptions.agent
117
- ? Object.assign({ logger: {
118
- // Hive Plugin should respect the given Yoga logger
119
- error: (...args) => yoga.logger.error(...args),
120
- info: (...args) => yoga.logger.info(...args),
121
- },
118
+ : createHive(Object.assign(Object.assign({}, clientOrOptions), { logger: (_a = clientOrOptions.logger) !== null && _a !== void 0 ? _a : new Logger({
119
+ writers: [
120
+ {
121
+ write(level, attrs, msg) {
122
+ level = level === 'trace' ? 'debug' : level;
123
+ yoga.logger[level](msg, attrs);
124
+ },
125
+ },
126
+ ],
127
+ }), agent: clientOrOptions.agent
128
+ ? Object.assign({
122
129
  // Hive Plugin should respect the given FetchAPI, note that this is not `yoga.fetch`
123
130
  fetch: (...args) => yoga.fetchAPI.fetch(...args) }, clientOrOptions.agent) : undefined }));
124
131
  void hive.info();
package/esm/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '0.44.0-alpha-20251124105143-3687098f1316893d86a181b7e3b7aa12704b90cb';
1
+ export const version = '0.44.0-alpha-20251125121050-94b0fd960a0afb15a2a04e903a711c75cb6020a2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-hive/yoga",
3
- "version": "0.44.0-alpha-20251124105143-3687098f1316893d86a181b7e3b7aa12704b90cb",
3
+ "version": "0.44.0-alpha-20251125121050-94b0fd960a0afb15a2a04e903a711c75cb6020a2",
4
4
  "description": "GraphQL Hive + GraphQL Yoga",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -8,8 +8,9 @@
8
8
  "graphql-yoga": "^5.10.8"
9
9
  },
10
10
  "dependencies": {
11
+ "@graphql-hive/logger": "^1.0.9",
11
12
  "@graphql-yoga/plugin-persisted-operations": "^3.9.0",
12
- "@graphql-hive/core": "0.16.0-alpha-20251124105143-3687098f1316893d86a181b7e3b7aa12704b90cb"
13
+ "@graphql-hive/core": "0.16.0-alpha-20251125121050-94b0fd960a0afb15a2a04e903a711c75cb6020a2"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -1,2 +1,2 @@
1
- export declare const version = "0.44.0-alpha-20251124105143-3687098f1316893d86a181b7e3b7aa12704b90cb";
1
+ export declare const version = "0.44.0-alpha-20251125121050-94b0fd960a0afb15a2a04e903a711c75cb6020a2";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare const version = "0.44.0-alpha-20251124105143-3687098f1316893d86a181b7e3b7aa12704b90cb";
1
+ export declare const version = "0.44.0-alpha-20251125121050-94b0fd960a0afb15a2a04e903a711c75cb6020a2";
2
2
  //# sourceMappingURL=version.d.ts.map