Skip to content

Commit

Permalink
Merge pull request #108 from FormidableLabs/JoviDeCroock-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
andyrichardson authored Nov 10, 2020
2 parents de595df + 73e0cdd commit d6b11e2
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -86,7 +86,7 @@
"wonka": ">= 4.0.9"
},
"peerDependencies": {
"@urql/core": ">= 1.11.0",
"@urql/core": ">= 1.14.0",
"graphql": ">= 0.11.0"
}
}
24 changes: 12 additions & 12 deletions src/exchange.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<any>();
Expand All @@ -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,
Expand All @@ -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<any>();
Expand All @@ -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,
Expand All @@ -168,7 +168,7 @@ describe('on operation', () => {

it('forwards operations', () => {
const operation = {
operationName: 'query',
kind: 'query',
key: 1,
};

Expand Down Expand Up @@ -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) => ({
Expand Down Expand Up @@ -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,
Expand All @@ -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) => ({
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -322,7 +322,7 @@ describe('on request message', () => {
},
},
"key": 1063934861,
"operationName": "query",
"kind": "query",
"query": Object {
"definitions": Array [
Object {
Expand Down
2 changes: 1 addition & 1 deletion src/exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
23 changes: 17 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit d6b11e2

Please sign in to comment.