@urql/exchange-persisted
Advanced tools
Comparing version 0.0.0-canary-20230320071339 to 0.0.0-canary-20230320071346
# @urql/exchange-persisted-fetch | ||
## 0.0.0-canary-20230320071339 | ||
## 0.0.0-canary-20230320071346 | ||
@@ -12,2 +12,7 @@ ### Major Changes | ||
### Minor Changes | ||
- Update exchanges to drop redundant `share` calls, since `@urql/core`’s `composeExchanges` utility now automatically does so for us | ||
Submitted by [@kitten](https://github.com/kitten) (See [#3082](https://github.com/urql-graphql/urql/pull/3082)) | ||
### Patch Changes | ||
@@ -19,4 +24,4 @@ | ||
Submitted by [@kitten](https://github.com/kitten) (See [#3072](https://github.com/urql-graphql/urql/pull/3072)) | ||
- Updated dependencies (See [#3033](https://github.com/urql-graphql/urql/pull/3033), [#3054](https://github.com/urql-graphql/urql/pull/3054), [#3053](https://github.com/urql-graphql/urql/pull/3053), [#3060](https://github.com/urql-graphql/urql/pull/3060), [#3039](https://github.com/urql-graphql/urql/pull/3039), [#3061](https://github.com/urql-graphql/urql/pull/3061), [#3055](https://github.com/urql-graphql/urql/pull/3055), [#3085](https://github.com/urql-graphql/urql/pull/3085), [#3079](https://github.com/urql-graphql/urql/pull/3079), [#3059](https://github.com/urql-graphql/urql/pull/3059), [#3055](https://github.com/urql-graphql/urql/pull/3055), [#3057](https://github.com/urql-graphql/urql/pull/3057), [#3050](https://github.com/urql-graphql/urql/pull/3050), [#3062](https://github.com/urql-graphql/urql/pull/3062), [#3051](https://github.com/urql-graphql/urql/pull/3051), [#3043](https://github.com/urql-graphql/urql/pull/3043), [#3063](https://github.com/urql-graphql/urql/pull/3063), [#3054](https://github.com/urql-graphql/urql/pull/3054), [#3058](https://github.com/urql-graphql/urql/pull/3058), and [#3062](https://github.com/urql-graphql/urql/pull/3062)) | ||
- @urql/core@0.0.0-canary-20230320071339 | ||
- Updated dependencies (See [#3033](https://github.com/urql-graphql/urql/pull/3033), [#3054](https://github.com/urql-graphql/urql/pull/3054), [#3053](https://github.com/urql-graphql/urql/pull/3053), [#3060](https://github.com/urql-graphql/urql/pull/3060), [#3039](https://github.com/urql-graphql/urql/pull/3039), [#3082](https://github.com/urql-graphql/urql/pull/3082), [#3061](https://github.com/urql-graphql/urql/pull/3061), [#3055](https://github.com/urql-graphql/urql/pull/3055), [#3085](https://github.com/urql-graphql/urql/pull/3085), [#3079](https://github.com/urql-graphql/urql/pull/3079), [#3059](https://github.com/urql-graphql/urql/pull/3059), [#3055](https://github.com/urql-graphql/urql/pull/3055), [#3057](https://github.com/urql-graphql/urql/pull/3057), [#3050](https://github.com/urql-graphql/urql/pull/3050), [#3062](https://github.com/urql-graphql/urql/pull/3062), [#3051](https://github.com/urql-graphql/urql/pull/3051), [#3043](https://github.com/urql-graphql/urql/pull/3043), [#3063](https://github.com/urql-graphql/urql/pull/3063), [#3054](https://github.com/urql-graphql/urql/pull/3054), [#3058](https://github.com/urql-graphql/urql/pull/3058), and [#3062](https://github.com/urql-graphql/urql/pull/3062)) | ||
- @urql/core@0.0.0-canary-20230320071346 | ||
@@ -23,0 +28,0 @@ ## 2.1.0 |
@@ -85,4 +85,3 @@ Object.defineProperty(exports, '__esModule', { | ||
var retries = wonka.makeSubject(); | ||
var sharedOps$ = wonka.share(operations$); | ||
var forwardedOps$ = wonka.filter(operation => !operationFilter(operation))(sharedOps$); | ||
var forwardedOps$ = wonka.filter(operation => !operationFilter(operation))(operations$); | ||
var persistedOps$ = wonka.mergeMap(wonka.fromPromise)(wonka.map(async operation => { | ||
@@ -107,3 +106,3 @@ var persistedOperation = core.makeOperation(operation.kind, operation, { | ||
return persistedOperation; | ||
})(wonka.filter(operationFilter)(sharedOps$))); | ||
})(wonka.filter(operationFilter)(operations$))); | ||
return wonka.filter(result => !!result)(wonka.map(result => { | ||
@@ -110,0 +109,0 @@ if (!enforcePersistedQueries && result.operation.extensions && result.operation.extensions.persistedQuery) { |
@@ -1,2 +0,2 @@ | ||
Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("wonka"),t=require("@urql/core"),n="undefined"!=typeof window?window.crypto:"undefined"!=typeof self?self.crypto:null,s=async r=>{if(n&&n.subtle){var t=await n.subtle.digest({name:"SHA-256"},(new TextEncoder).encode(r));return new Uint8Array(t).reduce(((e,r)=>e+r.toString(16).padStart(2,"0")),"")}return await(async()=>{if(!e)try{e=new Function("require",'return require("crypto")')(require)}catch(r){try{e=new Function('return import("crypto")')()}catch(e){}}return e})()?(await e).createHash("sha256").update(r).digest("hex"):""};exports.persistedExchange=e=>({forward:n})=>{e||(e={});var i=!!e.preferGetForPersistedQueries,o=!!e.enforcePersistedQueries,a=e.generateHash||s,u=!!e.enableForMutation,p=!0,d=e=>p&&!e.context.persistAttempt&&(u&&"mutation"===e.kind||"query"===e.kind);return e=>{var s=r.makeSubject(),u=r.share(e),c=r.filter((e=>!d(e)))(u),y=r.mergeMap(r.fromPromise)(r.map((async e=>{var r=t.makeOperation(e.kind,e,{...e.context,persistAttempt:!0}),n=await a(t.stringifyDocument(e.query),e.query);return n&&(r.extensions={...r.extensions,persistedQuery:{version:1,sha256Hash:n}},"query"===r.kind&&i&&(r.context.preferGetMethod="force")),r}))(r.filter(d)(u)));return r.filter((e=>!!e))(r.map((e=>{if(!o&&e.operation.extensions&&e.operation.extensions.persistedQuery){if(e.error&&e.error.graphQLErrors.some((e=>"PersistedQueryNotSupported"===e.message))){p=!1;var r=t.makeOperation(e.operation.kind,e.operation);return r.extensions&&delete r.extensions.persistedQuery,s.next(r),null}if(e.error&&e.error.graphQLErrors.some((e=>"PersistedQueryNotFound"===e.message))){var n=t.makeOperation(e.operation.kind,e.operation);return n.extensions={...n.extensions,persistedQuery:{...(n.extensions||{}).persistedQuery,miss:!0}},s.next(n),null}}return e}))(n(r.merge([y,c,s.source]))))}}; | ||
Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("wonka"),t=require("@urql/core"),n="undefined"!=typeof window?window.crypto:"undefined"!=typeof self?self.crypto:null,s=async r=>{if(n&&n.subtle){var t=await n.subtle.digest({name:"SHA-256"},(new TextEncoder).encode(r));return new Uint8Array(t).reduce(((e,r)=>e+r.toString(16).padStart(2,"0")),"")}return await(async()=>{if(!e)try{e=new Function("require",'return require("crypto")')(require)}catch(r){try{e=new Function('return import("crypto")')()}catch(e){}}return e})()?(await e).createHash("sha256").update(r).digest("hex"):""};exports.persistedExchange=e=>({forward:n})=>{e||(e={});var i=!!e.preferGetForPersistedQueries,o=!!e.enforcePersistedQueries,a=e.generateHash||s,u=!!e.enableForMutation,p=!0,d=e=>p&&!e.context.persistAttempt&&(u&&"mutation"===e.kind||"query"===e.kind);return e=>{var s=r.makeSubject(),u=r.filter((e=>!d(e)))(e),c=r.mergeMap(r.fromPromise)(r.map((async e=>{var r=t.makeOperation(e.kind,e,{...e.context,persistAttempt:!0}),n=await a(t.stringifyDocument(e.query),e.query);return n&&(r.extensions={...r.extensions,persistedQuery:{version:1,sha256Hash:n}},"query"===r.kind&&i&&(r.context.preferGetMethod="force")),r}))(r.filter(d)(e)));return r.filter((e=>!!e))(r.map((e=>{if(!o&&e.operation.extensions&&e.operation.extensions.persistedQuery){if(e.error&&e.error.graphQLErrors.some((e=>"PersistedQueryNotSupported"===e.message))){p=!1;var r=t.makeOperation(e.operation.kind,e.operation);return r.extensions&&delete r.extensions.persistedQuery,s.next(r),null}if(e.error&&e.error.graphQLErrors.some((e=>"PersistedQueryNotFound"===e.message))){var n=t.makeOperation(e.operation.kind,e.operation);return n.extensions={...n.extensions,persistedQuery:{...(n.extensions||{}).persistedQuery,miss:!0}},s.next(n),null}}return e}))(n(r.merge([c,u,s.source]))))}}; | ||
//# sourceMappingURL=urql-exchange-persisted.min.js.map |
{ | ||
"name": "@urql/exchange-persisted", | ||
"version": "0.0.0-canary-20230320071339", | ||
"version": "0.0.0-canary-20230320071346", | ||
"description": "An exchange that allows for persisted queries support when fetching queries", | ||
@@ -40,3 +40,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@urql/core": "0.0.0-canary-20230320071339", | ||
"@urql/core": "0.0.0-canary-20230320071346", | ||
"wonka": "^6.0.0" | ||
@@ -49,3 +49,3 @@ }, | ||
"graphql": "^16.0.0", | ||
"@urql/core": "0.0.0-canary-20230320071339" | ||
"@urql/core": "0.0.0-canary-20230320071346" | ||
}, | ||
@@ -52,0 +52,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
81423
328
+ Added@urql/core@0.0.0-canary-20230320071346(transitive)
- Removed@urql/core@0.0.0-canary-20230320071339(transitive)