@rxdi/graphql-client 0.7.260 → 0.7.262
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/dist/graphql.injection.d.ts +10 -0
- package/dist/graphql.injection.js +9 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.js +2 -10
- package/package.json +2 -2
|
@@ -89,3 +89,13 @@ export interface Definintion {
|
|
|
89
89
|
kind: string;
|
|
90
90
|
operation?: string;
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Ask for one operation to go over the WebSocket instead of HTTP:
|
|
94
|
+
* `client.mutate({ ..., context: OVER_WEBSOCKET })`. For chatty operations
|
|
95
|
+
* that must not pay a request each (a terminal's keystrokes): the socket is
|
|
96
|
+
* already open, with no HTTP / TLS / gateway per message. The server must
|
|
97
|
+
* execute that operation over its subscriptions socket.
|
|
98
|
+
*/
|
|
99
|
+
export declare const OVER_WEBSOCKET: {
|
|
100
|
+
readonly transport: "websocket";
|
|
101
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.noop = exports.noopHeaders = exports.GraphqlDocuments = exports.GraphqlSubscriptionClient = exports.ApolloClient = void 0;
|
|
3
|
+
exports.OVER_WEBSOCKET = exports.noop = exports.noopHeaders = exports.GraphqlDocuments = exports.GraphqlSubscriptionClient = exports.ApolloClient = void 0;
|
|
4
4
|
exports.isAuthorizationConnectionError = isAuthorizationConnectionError;
|
|
5
5
|
const core_1 = require("@rxdi/core");
|
|
6
6
|
exports.ApolloClient = new core_1.InjectionToken('apollo-link');
|
|
@@ -51,3 +51,11 @@ const noopHeaders = () => new Headers();
|
|
|
51
51
|
exports.noopHeaders = noopHeaders;
|
|
52
52
|
const noop = () => null;
|
|
53
53
|
exports.noop = noop;
|
|
54
|
+
/**
|
|
55
|
+
* Ask for one operation to go over the WebSocket instead of HTTP:
|
|
56
|
+
* `client.mutate({ ..., context: OVER_WEBSOCKET })`. For chatty operations
|
|
57
|
+
* that must not pay a request each (a terminal's keystrokes): the socket is
|
|
58
|
+
* already open, with no HTTP / TLS / gateway per message. The server must
|
|
59
|
+
* execute that operation over its subscriptions socket.
|
|
60
|
+
*/
|
|
61
|
+
exports.OVER_WEBSOCKET = { transport: 'websocket' };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { ModuleWithServices } from '@rxdi/core';
|
|
2
2
|
import type { DocumentNode } from '@apollo/client/core';
|
|
3
3
|
import { GraphqlModuleConfig } from './graphql.injection';
|
|
4
|
-
/**
|
|
5
|
-
* Ask for one operation to go over the WebSocket instead of HTTP:
|
|
6
|
-
* `client.mutate({ ..., context: OVER_WEBSOCKET })`. For chatty operations
|
|
7
|
-
* that must not pay a request each (a terminal's keystrokes): the socket is
|
|
8
|
-
* already open, with no HTTP / TLS / gateway per message. The server must
|
|
9
|
-
* execute that operation over its subscriptions socket.
|
|
10
|
-
*/
|
|
11
|
-
export declare const OVER_WEBSOCKET: {
|
|
12
|
-
readonly transport: "websocket";
|
|
13
|
-
};
|
|
14
4
|
/** The link split: subscriptions always over the WebSocket (as before),
|
|
15
5
|
any other operation only when its context asks (OVER_WEBSOCKET). */
|
|
16
6
|
export declare function overWebSocket(operation: {
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
30
30
|
};
|
|
31
31
|
var GraphqlModule_1;
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.InMemoryCache = exports.GraphqlModule =
|
|
33
|
+
exports.InMemoryCache = exports.GraphqlModule = void 0;
|
|
34
34
|
exports.overWebSocket = overWebSocket;
|
|
35
35
|
const core_1 = require("@rxdi/core");
|
|
36
36
|
const cache_1 = require("@apollo/client/cache");
|
|
@@ -40,14 +40,6 @@ const ws_1 = require("@apollo/client/link/ws");
|
|
|
40
40
|
const subscription_client_1 = require("./subscription-client");
|
|
41
41
|
const utilities_1 = require("@apollo/client/utilities");
|
|
42
42
|
const context_1 = require("@apollo/client/link/context");
|
|
43
|
-
/**
|
|
44
|
-
* Ask for one operation to go over the WebSocket instead of HTTP:
|
|
45
|
-
* `client.mutate({ ..., context: OVER_WEBSOCKET })`. For chatty operations
|
|
46
|
-
* that must not pay a request each (a terminal's keystrokes): the socket is
|
|
47
|
-
* already open, with no HTTP / TLS / gateway per message. The server must
|
|
48
|
-
* execute that operation over its subscriptions socket.
|
|
49
|
-
*/
|
|
50
|
-
exports.OVER_WEBSOCKET = { transport: 'websocket' };
|
|
51
43
|
/** The link split: subscriptions always over the WebSocket (as before),
|
|
52
44
|
any other operation only when its context asks (OVER_WEBSOCKET). */
|
|
53
45
|
function overWebSocket(operation) {
|
|
@@ -57,7 +49,7 @@ function overWebSocket(operation) {
|
|
|
57
49
|
return false;
|
|
58
50
|
}
|
|
59
51
|
return (type === 'subscription' ||
|
|
60
|
-
((_b = (_a = operation.getContext) === null || _a === void 0 ? void 0 : _a.call(operation)) === null || _b === void 0 ? void 0 : _b.transport) ===
|
|
52
|
+
((_b = (_a = operation.getContext) === null || _a === void 0 ? void 0 : _a.call(operation)) === null || _b === void 0 ? void 0 : _b.transport) === graphql_injection_1.OVER_WEBSOCKET.transport);
|
|
61
53
|
}
|
|
62
54
|
let GraphqlModule = GraphqlModule_1 = class GraphqlModule {
|
|
63
55
|
static forRoot({ uri, pubsub, refreshOnUnauthenticated, onRequest, cache, apolloRequestHandler, cancelPendingRequests, apolloClientOptions, httpOptions = {}, pubsubOptions = {}, onSubscriptionConnectionError, } = {}, documents = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdi/graphql-client",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.262",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"author": "Kristiyan Tachev",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"subscriptions-transport-ws": "^0.9.19"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@rxdi/core": "^0.7.
|
|
20
|
+
"@rxdi/core": "^0.7.261",
|
|
21
21
|
"@types/jest": "^29.5.0",
|
|
22
22
|
"graphql": "^16.12.0",
|
|
23
23
|
"jest": "^29.7.0",
|