Skip to content

Commit

Permalink
fix(deps): update gateway dependencies (#8244)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored and ardatan committed Jan 10, 2025
1 parent 134f062 commit c85f182
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 308 deletions.
6 changes: 6 additions & 0 deletions .changeset/shaggy-cooks-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-mesh/transform-hive': patch
'@graphql-mesh/plugin-hive': patch
---

Bump Hive Console dependencies
2 changes: 1 addition & 1 deletion examples/hive-example/sources/authors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"typescript": "^5.4.2"
},
"devDependencies": {
"@graphql-hive/cli": "0.44.5",
"@graphql-hive/cli": "0.45.0",
"@graphql-mesh/cli": "0.98.17",
"@graphql-mesh/openapi": "0.108.13",
"graphql": "16.10.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/hive-example/sources/books/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"typescript": "^5.4.2"
},
"devDependencies": {
"@graphql-hive/cli": "0.44.5",
"@graphql-hive/cli": "0.45.0",
"@graphql-mesh/cli": "0.98.17",
"@graphql-mesh/openapi": "0.108.13",
"graphql": "16.10.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/v1-next/hive-example/my-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "node --import tsx index.ts"
},
"dependencies": {
"@graphql-hive/cli": "0.44.5",
"@graphql-hive/cli": "0.45.0",
"graphql": "16.10.0",
"graphql-yoga": "5.10.9"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/v1-next/hive-example/my-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "node --import tsx index.ts"
},
"dependencies": {
"@graphql-hive/cli": "0.44.5",
"@graphql-hive/cli": "0.45.0",
"@graphql-mesh/compose-cli": "workspace:*",
"@omnigraph/openapi": "workspace:*",
"fets": "0.8.4",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
},
"resolutions": {
"@changesets/assemble-release-plan": "patch:@changesets/assemble-release-plan@npm%3A5.2.3#~/.yarn/patches/@changesets-assemble-release-plan-npm-5.2.3-296454a28f.patch",
"@whatwg-node/fetch": "0.10.1",
"@whatwg-node/node-fetch": "0.7.5",
"@whatwg-node/fetch": "0.10.3",
"@whatwg-node/node-fetch": "0.7.7",
"@whatwg-node/server": "0.9.65",
"es5-ext": "0.10.64",
"esbuild": "^0.24.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/legacy/transforms/hive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"graphql": "*"
},
"dependencies": {
"@graphql-hive/core": "^0.8.1",
"@graphql-hive/yoga": "^0.39.0",
"@graphql-hive/core": "^0.8.3",
"@graphql-mesh/cross-helpers": "^0.4.9",
"@graphql-mesh/string-interpolation": "^0.5.7",
"@graphql-mesh/types": "^0.103.11",
Expand Down
25 changes: 3 additions & 22 deletions packages/legacy/transforms/hive/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isSchema, Kind, visit, type ExecutionResult, type GraphQLSchema } from 'graphql';
import type { HiveClient, HivePluginOptions } from '@graphql-hive/core';
import { createHive } from '@graphql-hive/yoga';
import { Kind, visit, type ExecutionResult, type GraphQLSchema } from 'graphql';
import { createHive, type HiveClient, type HivePluginOptions } from '@graphql-hive/core';
import { process } from '@graphql-mesh/cross-helpers';
import { stringInterpolator } from '@graphql-mesh/string-interpolation';
import type { MeshTransform, MeshTransformOptions, YamlConfig } from '@graphql-mesh/types';
Expand All @@ -16,7 +15,7 @@ export default class HiveTransform implements MeshTransform {
private hiveClient: HiveClient;
private logger: MeshTransformOptions<YamlConfig.HivePlugin>['logger'];
private schema: GraphQLSchema;
constructor({ config, pubsub, logger }: MeshTransformOptions<YamlConfig.HivePlugin>) {
constructor({ config, logger }: MeshTransformOptions<YamlConfig.HivePlugin>) {
this.logger = logger;
const enabled =
// eslint-disable-next-line no-new-func
Expand Down Expand Up @@ -77,26 +76,8 @@ export default class HiveTransform implements MeshTransform {
agent,
usage,
reporting,
autoDispose: false,
selfHosting: config.selfHosting,
});
const id = pubsub.subscribe('destroy', () => {
try {
mapMaybePromise(
this.hiveClient.dispose(),
() => {
pubsub.unsubscribe(id);
},
e => {
logger.error(`Hive client failed to dispose`, e);
pubsub.unsubscribe(id);
},
);
} catch (e) {
logger.error(`Failed to dispose hive client`, e);
pubsub.unsubscribe(id);
}
});
}

transformSchema(schema: GraphQLSchema) {
Expand Down
2 changes: 1 addition & 1 deletion packages/loaders/openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@whatwg-node/fetch": "0.10.1",
"@whatwg-node/fetch": "0.10.3",
"fets": "0.8.4",
"graphql-yoga": "5.10.9",
"json-bigint-patch": "0.0.8"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/deduplicate-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@whatwg-node/fetch": "0.10.1"
"@whatwg-node/fetch": "0.10.3"
},
"publishConfig": {
"access": "public",
Expand Down
5 changes: 2 additions & 3 deletions packages/plugins/hive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@
"graphql": "*"
},
"dependencies": {
"@graphql-hive/core": "^0.8.1",
"@graphql-hive/yoga": "^0.39.0",
"@graphql-hive/core": "^0.8.3",
"@graphql-hive/yoga": "^0.39.2",
"@graphql-mesh/cross-helpers": "^0.4.9",
"@graphql-mesh/string-interpolation": "0.5.7",
"@graphql-mesh/types": "^0.103.11",
"@graphql-mesh/utils": "^0.103.11",
"tslib": "^2.4.0"
},
"publishConfig": {
Expand Down
30 changes: 6 additions & 24 deletions packages/plugins/hive/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import type { HivePluginOptions } from '@graphql-hive/core';
import { createHive, useHive } from '@graphql-hive/yoga';
import { useHive } from '@graphql-hive/yoga';
import { process } from '@graphql-mesh/cross-helpers';
import { stringInterpolator } from '@graphql-mesh/string-interpolation';
import type { Logger, MeshPlugin, MeshPubSub, YamlConfig } from '@graphql-mesh/types';
import { makeAsyncDisposable } from '@graphql-mesh/utils';
import type { Logger, MeshPlugin, YamlConfig } from '@graphql-mesh/types';

export default function useMeshHive<TContext>(
pluginOptions: YamlConfig.HivePlugin & {
logger?: Logger;
pubsub?: MeshPubSub;
},
): MeshPlugin<TContext> {
const enabled =
Expand Down Expand Up @@ -106,7 +104,7 @@ export default function useMeshHive<TContext>(
}),
};
}
const hiveClient = createHive({
const yogaPluginOpts: HivePluginOptions = {
enabled:
// eslint-disable-next-line no-unneeded-ternary -- for brevity
persistedDocuments && !token
Expand All @@ -118,24 +116,8 @@ export default function useMeshHive<TContext>(
usage,
reporting,
selfHosting,
// Mesh already disposes the client below on Mesh's `destroy` event
autoDispose: false,
experimental__persistedDocuments: persistedDocuments,
});
// TODO: Remove later after v0
// Pubsub.destroy will no longer
function onTerminate() {
return hiveClient
.dispose()
.catch(e => pluginOptions.logger?.error(`Hive client failed to dispose`, e));
}
const id: number = pluginOptions.pubsub?.subscribe('destroy', () =>
onTerminate().finally(() => pluginOptions.pubsub.unsubscribe(id)),
);

return makeAsyncDisposable<MeshPlugin<TContext>>(
// @ts-expect-error - Typings are wrong
useHive(hiveClient),
onTerminate,
);
};
// @ts-expect-error - Typings are incorrect
return useHive(yogaPluginOpts);
}
Loading

0 comments on commit c85f182

Please sign in to comment.