@graphql-mesh/plugin-hive 0.103.11 → 0.103.12

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
@@ -4,7 +4,6 @@ exports.default = useMeshHive;
4
4
  const yoga_1 = require("@graphql-hive/yoga");
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-mesh/utils");
8
7
  function useMeshHive(pluginOptions) {
9
8
  const enabled = pluginOptions != null && 'enabled' in pluginOptions
10
9
  ? typeof pluginOptions.enabled === 'string'
@@ -97,7 +96,7 @@ function useMeshHive(pluginOptions) {
97
96
  }),
98
97
  };
99
98
  }
100
- const hiveClient = (0, yoga_1.createHive)({
99
+ const yogaPluginOpts = {
101
100
  enabled:
102
101
  // eslint-disable-next-line no-unneeded-ternary -- for brevity
103
102
  persistedDocuments && !token
@@ -109,19 +108,8 @@ function useMeshHive(pluginOptions) {
109
108
  usage,
110
109
  reporting,
111
110
  selfHosting,
112
- // Mesh already disposes the client below on Mesh's `destroy` event
113
- autoDispose: false,
114
111
  experimental__persistedDocuments: persistedDocuments,
115
- });
116
- // TODO: Remove later after v0
117
- // Pubsub.destroy will no longer
118
- function onTerminate() {
119
- return hiveClient
120
- .dispose()
121
- .catch(e => pluginOptions.logger?.error(`Hive client failed to dispose`, e));
122
- }
123
- const id = pluginOptions.pubsub?.subscribe('destroy', () => onTerminate().finally(() => pluginOptions.pubsub.unsubscribe(id)));
124
- return (0, utils_1.makeAsyncDisposable)(
125
- // @ts-expect-error - Typings are wrong
126
- (0, yoga_1.useHive)(hiveClient), onTerminate);
112
+ };
113
+ // @ts-expect-error - Typings are incorrect
114
+ return (0, yoga_1.useHive)(yogaPluginOpts);
127
115
  }
package/esm/index.js CHANGED
@@ -1,7 +1,6 @@
1
- import { createHive, useHive } from '@graphql-hive/yoga';
1
+ import { useHive } from '@graphql-hive/yoga';
2
2
  import { process } from '@graphql-mesh/cross-helpers';
3
3
  import { stringInterpolator } from '@graphql-mesh/string-interpolation';
4
- import { makeAsyncDisposable } from '@graphql-mesh/utils';
5
4
  export default function useMeshHive(pluginOptions) {
6
5
  const enabled = pluginOptions != null && 'enabled' in pluginOptions
7
6
  ? typeof pluginOptions.enabled === 'string'
@@ -94,7 +93,7 @@ export default function useMeshHive(pluginOptions) {
94
93
  }),
95
94
  };
96
95
  }
97
- const hiveClient = createHive({
96
+ const yogaPluginOpts = {
98
97
  enabled:
99
98
  // eslint-disable-next-line no-unneeded-ternary -- for brevity
100
99
  persistedDocuments && !token
@@ -106,19 +105,8 @@ export default function useMeshHive(pluginOptions) {
106
105
  usage,
107
106
  reporting,
108
107
  selfHosting,
109
- // Mesh already disposes the client below on Mesh's `destroy` event
110
- autoDispose: false,
111
108
  experimental__persistedDocuments: persistedDocuments,
112
- });
113
- // TODO: Remove later after v0
114
- // Pubsub.destroy will no longer
115
- function onTerminate() {
116
- return hiveClient
117
- .dispose()
118
- .catch(e => pluginOptions.logger?.error(`Hive client failed to dispose`, e));
119
- }
120
- const id = pluginOptions.pubsub?.subscribe('destroy', () => onTerminate().finally(() => pluginOptions.pubsub.unsubscribe(id)));
121
- return makeAsyncDisposable(
122
- // @ts-expect-error - Typings are wrong
123
- useHive(hiveClient), onTerminate);
109
+ };
110
+ // @ts-expect-error - Typings are incorrect
111
+ return useHive(yogaPluginOpts);
124
112
  }
package/package.json CHANGED
@@ -1,17 +1,16 @@
1
1
  {
2
2
  "name": "@graphql-mesh/plugin-hive",
3
- "version": "0.103.11",
3
+ "version": "0.103.12",
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",
10
+ "@graphql-hive/yoga": "^0.39.2",
11
11
  "@graphql-mesh/cross-helpers": "^0.4.9",
12
12
  "@graphql-mesh/string-interpolation": "0.5.7",
13
13
  "@graphql-mesh/types": "^0.103.11",
14
- "@graphql-mesh/utils": "^0.103.11",
15
14
  "tslib": "^2.4.0"
16
15
  },
17
16
  "repository": {
@@ -1,5 +1,4 @@
1
- import type { Logger, MeshPlugin, MeshPubSub, YamlConfig } from '@graphql-mesh/types';
1
+ import type { Logger, MeshPlugin, YamlConfig } from '@graphql-mesh/types';
2
2
  export default function useMeshHive<TContext>(pluginOptions: YamlConfig.HivePlugin & {
3
3
  logger?: Logger;
4
- pubsub?: MeshPubSub;
5
4
  }): MeshPlugin<TContext>;
@@ -1,5 +1,4 @@
1
- import type { Logger, MeshPlugin, MeshPubSub, YamlConfig } from '@graphql-mesh/types';
1
+ import type { Logger, MeshPlugin, YamlConfig } from '@graphql-mesh/types';
2
2
  export default function useMeshHive<TContext>(pluginOptions: YamlConfig.HivePlugin & {
3
3
  logger?: Logger;
4
- pubsub?: MeshPubSub;
5
4
  }): MeshPlugin<TContext>;