@graphitation/apollo-react-relay-duct-tape 0.8.1 → 0.8.3
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/.eslintcache +1 -1
- package/CHANGELOG.md +20 -2
- package/lib/hooks.d.ts.map +1 -1
- package/lib/hooks.js +16 -3
- package/lib/hooks.mjs +7 -2
- package/lib/index.js +1 -0
- package/lib/types.js +1 -0
- package/package.json +3 -3
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx":"1","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts":"2","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts":"3","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts":"4"},{"size":
|
|
1
|
+
[{"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx":"1","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts":"2","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts":"3","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts":"4"},{"size":10112,"mtime":1681824509459,"results":"5","hashOfConfig":"6"},{"size":10314,"mtime":1681824509459,"results":"7","hashOfConfig":"6"},{"size":50,"mtime":1681824509459,"results":"8","hashOfConfig":"6"},{"size":1355,"mtime":1681824509459,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1viti9w",{"filePath":"12","messages":"13","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts",[]]
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @graphitation/apollo-react-relay-duct-tape
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 18 Apr 2023 13:35:58 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.8.3
|
|
8
|
+
|
|
9
|
+
Tue, 18 Apr 2023 13:35:58 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Bump @graphitation/apollo-mock-client to v0.10.17
|
|
14
|
+
- Bump @graphitation/graphql-js-operation-payload-generator to v0.12.2
|
|
15
|
+
|
|
16
|
+
## 0.8.2
|
|
17
|
+
|
|
18
|
+
Mon, 13 Mar 2023 14:00:55 GMT
|
|
19
|
+
|
|
20
|
+
### Patches
|
|
21
|
+
|
|
22
|
+
- Bump @graphitation/apollo-mock-client to v0.10.16
|
|
23
|
+
- Bump @graphitation/graphql-js-operation-payload-generator to v0.12.1
|
|
24
|
+
|
|
7
25
|
## 0.8.1
|
|
8
26
|
|
|
9
|
-
Thu, 24 Nov 2022 15:24:
|
|
27
|
+
Thu, 24 Nov 2022 15:24:56 GMT
|
|
10
28
|
|
|
11
29
|
### Patches
|
|
12
30
|
|
package/lib/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks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 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -30,7 +31,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
30
31
|
}
|
|
31
32
|
return to;
|
|
32
33
|
};
|
|
33
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
34
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
35
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
36
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
37
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
39
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
40
|
+
mod
|
|
41
|
+
));
|
|
34
42
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
43
|
var __async = (__this, __arguments, generator) => {
|
|
36
44
|
return new Promise((resolve, reject) => {
|
|
@@ -72,7 +80,10 @@ function useSubscription(config) {
|
|
|
72
80
|
const { error } = (0, import_client.useSubscription)(config.subscription, {
|
|
73
81
|
variables: config.variables,
|
|
74
82
|
onSubscriptionData: ({ subscriptionData }) => {
|
|
75
|
-
(0, import_invariant.default)(
|
|
83
|
+
(0, import_invariant.default)(
|
|
84
|
+
!subscriptionData.error,
|
|
85
|
+
"Did not expect to receive an error here"
|
|
86
|
+
);
|
|
76
87
|
if (subscriptionData.data && config.onNext) {
|
|
77
88
|
config.onNext(subscriptionData.data);
|
|
78
89
|
}
|
|
@@ -83,7 +94,9 @@ function useSubscription(config) {
|
|
|
83
94
|
if (config.onError) {
|
|
84
95
|
config.onError(error);
|
|
85
96
|
} else {
|
|
86
|
-
console.warn(
|
|
97
|
+
console.warn(
|
|
98
|
+
`An unhandled GraphQL subscription error occurred: ${error.message}`
|
|
99
|
+
);
|
|
87
100
|
}
|
|
88
101
|
}
|
|
89
102
|
}
|
package/lib/hooks.mjs
CHANGED
|
@@ -52,7 +52,10 @@ function useSubscription(config) {
|
|
|
52
52
|
const { error } = useApolloSubscription(config.subscription, {
|
|
53
53
|
variables: config.variables,
|
|
54
54
|
onSubscriptionData: ({ subscriptionData }) => {
|
|
55
|
-
invariant(
|
|
55
|
+
invariant(
|
|
56
|
+
!subscriptionData.error,
|
|
57
|
+
"Did not expect to receive an error here"
|
|
58
|
+
);
|
|
56
59
|
if (subscriptionData.data && config.onNext) {
|
|
57
60
|
config.onNext(subscriptionData.data);
|
|
58
61
|
}
|
|
@@ -63,7 +66,9 @@ function useSubscription(config) {
|
|
|
63
66
|
if (config.onError) {
|
|
64
67
|
config.onError(error);
|
|
65
68
|
} else {
|
|
66
|
-
console.warn(
|
|
69
|
+
console.warn(
|
|
70
|
+
`An unhandled GraphQL subscription error occurred: ${error.message}`
|
|
71
|
+
);
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
}
|
package/lib/index.js
CHANGED
package/lib/types.js
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphitation/apollo-react-relay-duct-tape",
|
|
3
3
|
"description": "A compatibility wrapper that provides the react-relay API on top of Apollo Client.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.3",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/microsoft/graphitation.git",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@apollo/client": "^3.3.15",
|
|
22
|
-
"@graphitation/apollo-mock-client": "^0.10.
|
|
23
|
-
"@graphitation/graphql-js-operation-payload-generator": "^0.12.
|
|
22
|
+
"@graphitation/apollo-mock-client": "^0.10.17",
|
|
23
|
+
"@graphitation/graphql-js-operation-payload-generator": "^0.12.2",
|
|
24
24
|
"@graphitation/graphql-js-tag": "^0.9.0",
|
|
25
25
|
"@types/jest": "^26.0.22",
|
|
26
26
|
"@types/react": "^17.0.3",
|