1
- import { isSchema , Kind , visit , type ExecutionResult , type GraphQLSchema } from 'graphql' ;
2
- import type { HiveClient , HivePluginOptions } from '@graphql-hive/core' ;
3
- import { createHive } from '@graphql-hive/yoga' ;
1
+ import { Kind , visit , type ExecutionResult , type GraphQLSchema } from 'graphql' ;
2
+ import { createHive , type HiveClient , type HivePluginOptions } from '@graphql-hive/core' ;
4
3
import { process } from '@graphql-mesh/cross-helpers' ;
5
4
import { stringInterpolator } from '@graphql-mesh/string-interpolation' ;
6
5
import type { MeshTransform , MeshTransformOptions , YamlConfig } from '@graphql-mesh/types' ;
@@ -16,7 +15,7 @@ export default class HiveTransform implements MeshTransform {
16
15
private hiveClient : HiveClient ;
17
16
private logger : MeshTransformOptions < YamlConfig . HivePlugin > [ 'logger' ] ;
18
17
private schema : GraphQLSchema ;
19
- constructor ( { config, pubsub , logger } : MeshTransformOptions < YamlConfig . HivePlugin > ) {
18
+ constructor ( { config, logger } : MeshTransformOptions < YamlConfig . HivePlugin > ) {
20
19
this . logger = logger ;
21
20
const enabled =
22
21
// eslint-disable-next-line no-new-func
@@ -77,26 +76,8 @@ export default class HiveTransform implements MeshTransform {
77
76
agent,
78
77
usage,
79
78
reporting,
80
- autoDispose : false ,
81
79
selfHosting : config . selfHosting ,
82
80
} ) ;
83
- const id = pubsub . subscribe ( 'destroy' , ( ) => {
84
- try {
85
- mapMaybePromise (
86
- this . hiveClient . dispose ( ) ,
87
- ( ) => {
88
- pubsub . unsubscribe ( id ) ;
89
- } ,
90
- e => {
91
- logger . error ( `Hive client failed to dispose` , e ) ;
92
- pubsub . unsubscribe ( id ) ;
93
- } ,
94
- ) ;
95
- } catch ( e ) {
96
- logger . error ( `Failed to dispose hive client` , e ) ;
97
- pubsub . unsubscribe ( id ) ;
98
- }
99
- } ) ;
100
81
}
101
82
102
83
transformSchema ( schema : GraphQLSchema ) {
0 commit comments