@kubun/with-apollo 0.5.0 → 0.7.0
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/lib/index.js +1 -1
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ApolloLink as
|
|
1
|
+
import{ApolloLink as r,Observable as e}from"@apollo/client";import{getMainDefinition as t,print as i}from"@apollo/client/utilities";function n(r){return new e(e=>{r.then(r=>{try{e.next(r),e.complete()}catch(r){e.error(r)}},r=>{e.error(r)})})}function o(r){return new e(e=>{e.error(r)})}export function createLink(e){let{client:a,graphID:u}=e;return new r(r=>{let e=t(r.query);if("OperationDefinition"!==e.kind)return o(Error(`Invalid definition: ${e.kind}, expected OperationDefinition`));switch(e.operation){case"query":return n(a.queryGraph({id:u,text:i(r.query),variables:r.variables}));case"mutation":return n(a.mutateGraph({id:u,text:i(r.query),variables:r.variables}));default:return o(Error(`Unsupported operation: ${e.operation}`))}})}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubun/with-apollo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "see LICENSE.md",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"type": "module",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
],
|
|
16
16
|
"sideEffects": false,
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@apollo/client": "^4.1.
|
|
19
|
-
"graphql": "^16.
|
|
18
|
+
"@apollo/client": "^4.1.6",
|
|
19
|
+
"graphql": "^16.13.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@kubun/client": "^0.
|
|
22
|
+
"@kubun/client": "^0.7.0"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build:clean": "del lib",
|