From e7c7ef899071e576ff7df1cacd191abd6dd5850b Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Sun, 8 Nov 2020 15:47:14 +0100 Subject: [PATCH 1/4] move away from the deprecated operationName --- src/exchange.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exchange.ts b/src/exchange.ts index 687ce5b..8e9376d 100644 --- a/src/exchange.ts +++ b/src/exchange.ts @@ -56,7 +56,7 @@ interface HandlerArgs { const handleOperation = ({ sendMessage }: HandlerArgs) => ( operation: Operation ) => { - if (operation.operationName === 'teardown') { + if (operation.kind === 'teardown') { const msg = createDebugMessage({ type: 'teardown', message: 'The operation has been torn down', From 835264e09b14cc4a7a7f3a280734439026eef88b Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Sun, 8 Nov 2020 15:48:16 +0100 Subject: [PATCH 2/4] bump core-peerDep for operation.kind --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3ccec5d..3f4aa99 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "wonka": ">= 4.0.9" }, "peerDependencies": { - "@urql/core": ">= 1.11.0", + "@urql/core": ">= 1.14.0", "graphql": ">= 0.11.0" } } From 4649f8284168cf51591f280f35585038d63fdac1 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Sun, 8 Nov 2020 15:49:28 +0100 Subject: [PATCH 3/4] Update exchange.test.ts --- src/exchange.test.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/exchange.test.ts b/src/exchange.test.ts index ade622a..c857170 100644 --- a/src/exchange.test.ts +++ b/src/exchange.test.ts @@ -28,8 +28,8 @@ let forward: any; beforeEach(() => { client = { url: 'url_stub', - createRequestOperation: jest.fn((operationName, data, meta) => ({ - operationName, + createRequestOperation: jest.fn((kind, data, meta) => ({ + kind, ...data, context: { meta, @@ -97,7 +97,7 @@ describe('on operation', () => { describe('on execute', () => { it('dispatches debug "update" event', () => { const operation = { - operationName: 'query', + kind: 'query', }; const { source, next } = makeSubject(); @@ -117,7 +117,7 @@ describe('on operation', () => { }, "message": "The client has received an execute command.", "operation": Object { - "operationName": "query", + "kind": "query", }, "source": "devtoolsExchange", "timestamp": 1234, @@ -134,7 +134,7 @@ describe('on operation', () => { describe('on teardown', () => { it('dispatches debug "teardown" event', () => { const operation = { - operationName: 'teardown', + kind: 'teardown', }; const { source, next } = makeSubject(); @@ -152,7 +152,7 @@ describe('on operation', () => { "data": undefined, "message": "The operation has been torn down", "operation": Object { - "operationName": "teardown", + "kind": "teardown", }, "source": "devtoolsExchange", "timestamp": 1234, @@ -168,7 +168,7 @@ describe('on operation', () => { it('forwards operations', () => { const operation = { - operationName: 'query', + kind: 'query', key: 1, }; @@ -198,7 +198,7 @@ describe('on operation response', () => { describe('on data', () => { it('dispatches update event', () => { const operation = { - operationName: 'mutation', + kind: 'mutation', }; forward.mockImplementation((o) => map((operation) => ({ @@ -228,7 +228,7 @@ describe('on operation response', () => { }, "message": "The operation has returned a new response.", "operation": Object { - "operationName": "mutation", + "kind": "mutation", }, "source": "devtoolsExchange", "timestamp": 1234, @@ -245,7 +245,7 @@ describe('on operation response', () => { describe('on error', () => { it('dispatches update event', () => { const operation = { - operationName: 'mutation', + kind: 'mutation', }; forward.mockImplementation((o) => map((operation) => ({ @@ -274,7 +274,7 @@ describe('on operation response', () => { }, "message": "The operation has returned a new error.", "operation": Object { - "operationName": "mutation", + "kind": "mutation", }, "source": "devtoolsExchange", "timestamp": 1234, @@ -322,7 +322,7 @@ describe('on request message', () => { }, }, "key": 1063934861, - "operationName": "query", + "kind": "query", "query": Object { "definitions": Array [ Object { From 73e0cdd349a2ec7851cb09c3fa85da8295ce8a46 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Tue, 10 Nov 2020 11:49:09 +0100 Subject: [PATCH 4/4] bump the urql core dependency --- package.json | 2 +- yarn.lock | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3f4aa99..8a62129 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@types/node": "^12.12.39", "@typescript-eslint/eslint-plugin": "^2.34.0", "@typescript-eslint/parser": "^2.34.0", - "@urql/core": "^1.11.8", + "@urql/core": "^1.15.0", "babel-plugin-closure-elimination": "^1.3.1", "babel-plugin-transform-async-to-promises": "^0.8.15", "eslint": "^7.1.0", diff --git a/yarn.lock b/yarn.lock index bf32e23..32eb6bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -459,6 +459,11 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@graphql-typed-document-node/core@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.0.tgz#0eee6373e11418bfe0b5638f654df7a4ca6a3950" + integrity sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz#10602de5570baea82f8afbfa2630b24e7a8cfe5b" @@ -909,12 +914,13 @@ semver "^7.3.2" tsutils "^3.17.1" -"@urql/core@^1.11.8": - version "1.11.8" - resolved "https://registry.yarnpkg.com/@urql/core/-/core-1.11.8.tgz#6a3186ac84d6b08752585f42e8ec81539338d7a9" - integrity sha512-lBlCjw3sLlblGIzRVg583IdsONUIt04f/LHI0oiEgNlPViZcRR3B31LCKyOChba/klIqSaDivaqCfzg5wyTPoQ== +"@urql/core@^1.15.0": + version "1.15.1" + resolved "https://registry.yarnpkg.com/@urql/core/-/core-1.15.1.tgz#fa49909f2841d092796dd540cef6e9df89222560" + integrity sha512-a05ablx/aKNCUc9dEbx0GvE28UC0sJ1FmfsSfmJNqecYlYeb4XvSQW4FLVy0e/MjQeB9op/weiVIEw+za2ssGw== dependencies: - wonka "^4.0.10" + "@graphql-typed-document-node/core" "^3.1.0" + wonka "^4.0.14" abab@^2.0.3: version "2.0.3" @@ -5190,11 +5196,16 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" -"wonka@>= 4.0.9", wonka@^4.0.10: +"wonka@>= 4.0.9": version "4.0.13" resolved "https://registry.yarnpkg.com/wonka/-/wonka-4.0.13.tgz#8d188160bd5742870c78ede7a4eba686d089a33f" integrity sha512-aWg92IVvbP/kp+q9rw+k/Uw3C/S2J0dTDNhEhivGVH3GXJZgpFk2nuyVtiS7Y1d0UG3m4jvOrR7bPXim6D/TBg== +wonka@^4.0.14: + version "4.0.15" + resolved "https://registry.yarnpkg.com/wonka/-/wonka-4.0.15.tgz#9aa42046efa424565ab8f8f451fcca955bf80b89" + integrity sha512-U0IUQHKXXn6PFo9nqsHphVCE5m3IntqZNB9Jjn7EB1lrR7YTDY3YWgFvEvwniTzXSvOH/XMzAZaIfJF/LvHYXg== + word-wrap@^1.2.3, word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"