@graphql-mesh/transform-hive 0.103.12 → 0.103.13

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
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const graphql_1 = require("graphql");
4
- const yoga_1 = require("@graphql-hive/yoga");
4
+ const core_1 = require("@graphql-hive/core");
5
5
  const cross_helpers_1 = require("@graphql-mesh/cross-helpers");
6
6
  const string_interpolation_1 = require("@graphql-mesh/string-interpolation");
7
- const utils_1 = require("@graphql-tools/utils");
8
7
  class HiveTransform {
9
- constructor({ config, pubsub, logger }) {
8
+ constructor({ config, logger }) {
10
9
  this.logger = logger;
11
10
  const enabled =
12
11
  // eslint-disable-next-line no-new-func
@@ -58,30 +57,15 @@ class HiveTransform {
58
57
  logger,
59
58
  };
60
59
  }
61
- this.hiveClient = (0, yoga_1.createHive)({
60
+ this.hiveClient = (0, core_1.createHive)({
62
61
  enabled,
63
62
  debug: !!cross_helpers_1.process.env.DEBUG,
64
63
  token,
65
64
  agent,
66
65
  usage,
67
66
  reporting,
68
- autoDispose: false,
69
67
  selfHosting: config.selfHosting,
70
68
  });
71
- const id = pubsub.subscribe('destroy', () => {
72
- try {
73
- (0, utils_1.mapMaybePromise)(this.hiveClient.dispose(), () => {
74
- pubsub.unsubscribe(id);
75
- }, e => {
76
- logger.error(`Hive client failed to dispose`, e);
77
- pubsub.unsubscribe(id);
78
- });
79
- }
80
- catch (e) {
81
- logger.error(`Failed to dispose hive client`, e);
82
- pubsub.unsubscribe(id);
83
- }
84
- });
85
69
  }
86
70
  transformSchema(schema) {
87
71
  this.hiveClient.reportSchema({ schema });
package/esm/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import { Kind, visit } from 'graphql';
2
- import { createHive } from '@graphql-hive/yoga';
2
+ import { createHive } from '@graphql-hive/core';
3
3
  import { process } from '@graphql-mesh/cross-helpers';
4
4
  import { stringInterpolator } from '@graphql-mesh/string-interpolation';
5
- import { mapMaybePromise } from '@graphql-tools/utils';
6
5
  export default class HiveTransform {
7
- constructor({ config, pubsub, logger }) {
6
+ constructor({ config, logger }) {
8
7
  this.logger = logger;
9
8
  const enabled =
10
9
  // eslint-disable-next-line no-new-func
@@ -63,23 +62,8 @@ export default class HiveTransform {
63
62
  agent,
64
63
  usage,
65
64
  reporting,
66
- autoDispose: false,
67
65
  selfHosting: config.selfHosting,
68
66
  });
69
- const id = pubsub.subscribe('destroy', () => {
70
- try {
71
- mapMaybePromise(this.hiveClient.dispose(), () => {
72
- pubsub.unsubscribe(id);
73
- }, e => {
74
- logger.error(`Hive client failed to dispose`, e);
75
- pubsub.unsubscribe(id);
76
- });
77
- }
78
- catch (e) {
79
- logger.error(`Failed to dispose hive client`, e);
80
- pubsub.unsubscribe(id);
81
- }
82
- });
83
67
  }
84
68
  transformSchema(schema) {
85
69
  this.hiveClient.reportSchema({ schema });
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@graphql-mesh/transform-hive",
3
- "version": "0.103.12",
3
+ "version": "0.103.13",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "*"
7
7
  },
8
8
  "dependencies": {
9
- "@graphql-hive/core": "^0.8.1",
10
- "@graphql-hive/yoga": "^0.39.0",
9
+ "@graphql-hive/core": "^0.8.3",
11
10
  "@graphql-mesh/cross-helpers": "^0.4.9",
12
11
  "@graphql-mesh/string-interpolation": "^0.5.7",
13
12
  "@graphql-mesh/types": "^0.103.11",
@@ -1,5 +1,5 @@
1
1
  import { type ExecutionResult, type GraphQLSchema } from 'graphql';
2
- import type { HiveClient } from '@graphql-hive/core';
2
+ import { type HiveClient } from '@graphql-hive/core';
3
3
  import type { MeshTransform, MeshTransformOptions, YamlConfig } from '@graphql-mesh/types';
4
4
  import type { DelegationContext } from '@graphql-tools/delegate';
5
5
  import { type ExecutionRequest } from '@graphql-tools/utils';
@@ -11,7 +11,7 @@ export default class HiveTransform implements MeshTransform {
11
11
  private hiveClient;
12
12
  private logger;
13
13
  private schema;
14
- constructor({ config, pubsub, logger }: MeshTransformOptions<YamlConfig.HivePlugin>);
14
+ constructor({ config, logger }: MeshTransformOptions<YamlConfig.HivePlugin>);
15
15
  transformSchema(schema: GraphQLSchema): GraphQLSchema;
16
16
  transformRequest(request: ExecutionRequest, delegationContext: DelegationContext, transformationContext: TransformationContext): ExecutionRequest<any, any, any, Record<string, any>, any>;
17
17
  transformResult(result: ExecutionResult, delegationContext: DelegationContext, transformationContext: TransformationContext): ExecutionResult<import("graphql/jsutils/ObjMap").ObjMap<unknown>, import("graphql/jsutils/ObjMap").ObjMap<unknown>>;
@@ -1,5 +1,5 @@
1
1
  import { type ExecutionResult, type GraphQLSchema } from 'graphql';
2
- import type { HiveClient } from '@graphql-hive/core';
2
+ import { type HiveClient } from '@graphql-hive/core';
3
3
  import type { MeshTransform, MeshTransformOptions, YamlConfig } from '@graphql-mesh/types';
4
4
  import type { DelegationContext } from '@graphql-tools/delegate';
5
5
  import { type ExecutionRequest } from '@graphql-tools/utils';
@@ -11,7 +11,7 @@ export default class HiveTransform implements MeshTransform {
11
11
  private hiveClient;
12
12
  private logger;
13
13
  private schema;
14
- constructor({ config, pubsub, logger }: MeshTransformOptions<YamlConfig.HivePlugin>);
14
+ constructor({ config, logger }: MeshTransformOptions<YamlConfig.HivePlugin>);
15
15
  transformSchema(schema: GraphQLSchema): GraphQLSchema;
16
16
  transformRequest(request: ExecutionRequest, delegationContext: DelegationContext, transformationContext: TransformationContext): ExecutionRequest<any, any, any, Record<string, any>, any>;
17
17
  transformResult(result: ExecutionResult, delegationContext: DelegationContext, transformationContext: TransformationContext): ExecutionResult<import("graphql/jsutils/ObjMap").ObjMap<unknown>, import("graphql/jsutils/ObjMap").ObjMap<unknown>>;