From b804e08a1d95d605ea025b2946badeacb2db3165 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Thu, 12 Dec 2019 16:21:16 +0000 Subject: [PATCH] Upgrade to urql 1.7.0 and use urql/core --- package.json | 4 ++-- src/cacheExchange.test.ts | 7 ++++++- src/cacheExchange.ts | 2 +- src/extras/relayPagination.ts | 2 +- src/extras/simplePagination.ts | 2 +- src/helpers/keys.ts | 2 +- src/populateExchange.test.ts | 2 +- src/populateExchange.ts | 2 +- src/store.ts | 2 +- yarn.lock | 24 ++++++------------------ 10 files changed, 21 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 9dba473..2f8a492 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ }, "peerDependencies": { "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0", - "urql": ">= 1.6.0" + "urql": ">= 1.7.0" }, "devDependencies": { "@ampproject/rollup-plugin-closure-compiler": "^0.13.0", @@ -131,6 +131,6 @@ "terser": "^4.4.2", "ts-jest": "^24.2.0", "typescript": "^3.7.3", - "urql": "^1.6.3" + "urql": "^1.7.0" } } diff --git a/src/cacheExchange.test.ts b/src/cacheExchange.test.ts index 69657fd..182d9db 100644 --- a/src/cacheExchange.test.ts +++ b/src/cacheExchange.test.ts @@ -1,5 +1,10 @@ import gql from 'graphql-tag'; -import { createClient, ExchangeIO, Operation, OperationResult } from 'urql'; +import { + createClient, + ExchangeIO, + Operation, + OperationResult, +} from 'urql/core'; import { pipe, map, makeSubject, tap, publish, delay } from 'wonka'; import { cacheExchange } from './cacheExchange'; diff --git a/src/cacheExchange.ts b/src/cacheExchange.ts index 0617824..d79fc85 100644 --- a/src/cacheExchange.ts +++ b/src/cacheExchange.ts @@ -5,7 +5,7 @@ import { OperationResult, RequestPolicy, CacheOutcome, -} from 'urql'; +} from 'urql/core'; import { IntrospectionQuery } from 'graphql'; import { filter, map, merge, pipe, share, tap } from 'wonka'; diff --git a/src/extras/relayPagination.ts b/src/extras/relayPagination.ts index 9f0fb8a..5b8b8d5 100644 --- a/src/extras/relayPagination.ts +++ b/src/extras/relayPagination.ts @@ -1,4 +1,4 @@ -import { stringifyVariables } from 'urql'; +import { stringifyVariables } from 'urql/core'; import { Cache, Resolver, Variables, NullArray } from '../types'; export type MergeMode = 'outwards' | 'inwards'; diff --git a/src/extras/simplePagination.ts b/src/extras/simplePagination.ts index 069e5fd..015cb5f 100644 --- a/src/extras/simplePagination.ts +++ b/src/extras/simplePagination.ts @@ -1,4 +1,4 @@ -import { stringifyVariables } from 'urql'; +import { stringifyVariables } from 'urql/core'; import { Resolver, Variables, NullArray } from '../types'; export interface PaginationParams { diff --git a/src/helpers/keys.ts b/src/helpers/keys.ts index 1917f64..7de2883 100644 --- a/src/helpers/keys.ts +++ b/src/helpers/keys.ts @@ -1,4 +1,4 @@ -import { stringifyVariables } from 'urql'; +import { stringifyVariables } from 'urql/core'; import { Variables, FieldInfo } from '../types'; export const keyOfField = (fieldName: string, args?: null | Variables) => diff --git a/src/populateExchange.test.ts b/src/populateExchange.test.ts index ebd21d0..698128a 100644 --- a/src/populateExchange.test.ts +++ b/src/populateExchange.test.ts @@ -9,7 +9,7 @@ import { import gql from 'graphql-tag'; import { fromValue, pipe, fromArray, toArray } from 'wonka'; -import { Client, Operation } from 'urql'; +import { Client, Operation } from 'urql/core'; import { populateExchange } from './populateExchange'; diff --git a/src/populateExchange.ts b/src/populateExchange.ts index 7de0fdd..0cdee33 100644 --- a/src/populateExchange.ts +++ b/src/populateExchange.ts @@ -18,7 +18,7 @@ import { } from 'graphql'; import { pipe, tap, map } from 'wonka'; -import { Exchange, Operation } from 'urql'; +import { Exchange, Operation } from 'urql/core'; import { getName, getSelectionSet, unwrapType } from './ast'; import { invariant, warn } from './helpers/help'; diff --git a/src/store.ts b/src/store.ts index 9ee53bc..464c557 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,5 +1,5 @@ import { DocumentNode } from 'graphql'; -import { createRequest } from 'urql'; +import { createRequest } from 'urql/core'; import { Cache, diff --git a/yarn.lock b/yarn.lock index cc43999..d540c9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3759,20 +3759,13 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" -magic-string@0.25.4: +magic-string@0.25.4, magic-string@^0.25.2, magic-string@^0.25.3: version "0.25.4" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.4.tgz#325b8a0a79fc423db109b77fd5a19183b7ba5143" integrity sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw== dependencies: sourcemap-codec "^1.4.4" -magic-string@^0.25.2, magic-string@^0.25.3: - version "0.25.3" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.3.tgz#34b8d2a2c7fec9d9bdf9929a3fd81d271ef35be9" - integrity sha512-6QK0OpF/phMz0Q2AxILkX2mFhi7m+WMwTRg0LQKq/WBB0cDP4rYH3Wp4/d3OTXlrPLVJT/RFqj8tFeAR4nk8AA== - dependencies: - sourcemap-codec "^1.4.4" - make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -4581,16 +4574,11 @@ pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" -process-nextick-args@^2.0.0: +process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== - progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" @@ -5907,10 +5895,10 @@ urlgrey@^0.4.4: resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-0.4.4.tgz#892fe95960805e85519f1cd4389f2cb4cbb7652f" integrity sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8= -urql@^1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/urql/-/urql-1.6.3.tgz#0484a90a01d6fc8d0a6fb96bb4b2b2146a612c0d" - integrity sha512-KX8qHTGo8deSg41rrQEk9JhJTz6w/LBCdWhYutYjbCUrkoAF4lEiCkgOEiO0fEf+hpDg0nQTTkHTpRbgQ0yh1g== +urql@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/urql/-/urql-1.7.0.tgz#3b5d53451e9b45163288618f2bad6fe0afc02e0e" + integrity sha512-mw9gZhq3u33FzT6nLIQGzTF/cVkl3+pM1Jr2mya9pyTQfRBMugurGpZTyIFZKZQK1zjSnO8LbI2gzelydctq3A== dependencies: react-wonka "^1.0.3" wonka "^3.2.1"