@rxdi/graphql-pubsub 0.7.194 → 0.7.195
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.
|
@@ -9,4 +9,12 @@ export declare class SubscriptionService implements PluginInterface {
|
|
|
9
9
|
constructor(server: Server, config: GRAPHQL_PLUGIN_CONFIG, pubConfig: GRAPHQL_PUB_SUB_DI_CONFIG);
|
|
10
10
|
OnInit(): void;
|
|
11
11
|
register(): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Cross compatability graphql v15 and v16 for subscriptions
|
|
14
|
+
*/
|
|
15
|
+
private execute;
|
|
16
|
+
/**
|
|
17
|
+
* Cross compatability graphql v15 and v16 for subscriptions
|
|
18
|
+
*/
|
|
19
|
+
private subscribe;
|
|
12
20
|
}
|
|
@@ -30,6 +30,7 @@ const hapi_1 = require("@rxdi/hapi");
|
|
|
30
30
|
const hapi_2 = require("@hapi/hapi");
|
|
31
31
|
const graphql_1 = require("@rxdi/graphql");
|
|
32
32
|
const config_tokens_1 = require("../config.tokens");
|
|
33
|
+
const graphql_2 = require("graphql");
|
|
33
34
|
let SubscriptionService = class SubscriptionService {
|
|
34
35
|
constructor(server, config, pubConfig) {
|
|
35
36
|
this.server = server;
|
|
@@ -43,8 +44,8 @@ let SubscriptionService = class SubscriptionService {
|
|
|
43
44
|
register() {
|
|
44
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
46
|
const currentC = {
|
|
46
|
-
execute:
|
|
47
|
-
subscribe:
|
|
47
|
+
execute: this.execute,
|
|
48
|
+
subscribe: this.subscribe,
|
|
48
49
|
schema: this.config.graphqlOptions.schema,
|
|
49
50
|
onConnect(connectionParams) {
|
|
50
51
|
// return connectionHookService.modifyHooks
|
|
@@ -59,7 +60,7 @@ let SubscriptionService = class SubscriptionService {
|
|
|
59
60
|
// params,
|
|
60
61
|
// webSocket
|
|
61
62
|
// );
|
|
62
|
-
}
|
|
63
|
+
},
|
|
63
64
|
};
|
|
64
65
|
if (this.pubConfig.authentication) {
|
|
65
66
|
const auth = core_1.Container.get(this.pubConfig.authentication);
|
|
@@ -80,6 +81,36 @@ let SubscriptionService = class SubscriptionService {
|
|
|
80
81
|
new subscriptions_transport_ws_1.SubscriptionServer(currentC, Object.assign({ server: this.server.listener, path: '/subscriptions' }, this.pubConfig.subscriptionServerOptions));
|
|
81
82
|
});
|
|
82
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Cross compatability graphql v15 and v16 for subscriptions
|
|
86
|
+
*/
|
|
87
|
+
execute(schema, node, rootValue, contextValue, variableValues, operationName, fieldResolver, subscribeFieldResolver) {
|
|
88
|
+
return (0, execution_1.execute)({
|
|
89
|
+
schema,
|
|
90
|
+
document: typeof node === 'string' ? (0, graphql_2.parse)(node) : node,
|
|
91
|
+
rootValue,
|
|
92
|
+
contextValue,
|
|
93
|
+
variableValues,
|
|
94
|
+
operationName,
|
|
95
|
+
fieldResolver,
|
|
96
|
+
subscribeFieldResolver,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Cross compatability graphql v15 and v16 for subscriptions
|
|
101
|
+
*/
|
|
102
|
+
subscribe(schema, node, rootValue, contextValue, variableValues, operationName, fieldResolver, subscribeFieldResolver) {
|
|
103
|
+
return (0, subscription_1.subscribe)({
|
|
104
|
+
schema,
|
|
105
|
+
document: typeof node === 'string' ? (0, graphql_2.parse)(node) : node,
|
|
106
|
+
rootValue,
|
|
107
|
+
contextValue,
|
|
108
|
+
variableValues,
|
|
109
|
+
operationName,
|
|
110
|
+
fieldResolver,
|
|
111
|
+
subscribeFieldResolver,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
83
114
|
};
|
|
84
115
|
exports.SubscriptionService = SubscriptionService;
|
|
85
116
|
exports.SubscriptionService = SubscriptionService = __decorate([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdi/graphql-pubsub",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.195",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/rxdi/graphql-pubsub"
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/rxdi/graphql-pubsub#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@rxdi/graphql-rabbitmq-subscriptions": "^0.7.
|
|
33
|
+
"@rxdi/graphql-rabbitmq-subscriptions": "^0.7.194",
|
|
34
34
|
"@apollo/client": "^3.7.3",
|
|
35
35
|
"graphql-request": "^1.8.2",
|
|
36
36
|
"subscriptions-transport-ws": "^0.9.19",
|
|
37
37
|
"ws": "6.2.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@rxdi/core": "^0.7.
|
|
41
|
-
"@rxdi/graphql": "^0.7.
|
|
42
|
-
"@rxdi/hapi": "^0.7.
|
|
40
|
+
"@rxdi/core": "^0.7.194",
|
|
41
|
+
"@rxdi/graphql": "^0.7.194",
|
|
42
|
+
"@rxdi/hapi": "^0.7.194",
|
|
43
43
|
"@types/graphql": "^14.5.0",
|
|
44
44
|
"@types/hapi": "^18.0.4",
|
|
45
45
|
"@types/jest": "^24.0.22",
|