Skip to content

Commit

Permalink
Use Event from @whatwg-node/fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Jul 27, 2022
1 parent 331e812 commit ba9e296
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/error-handling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"dependencies": {
"graphql-yoga": "2.13.4",
"@whatwg-node/fetch": "^0.1.1",
"@whatwg-node/fetch": "^0.2.2",
"graphql": "^16.1.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"typescript": "4.7.4"
},
"resolutions": {
"@whatwg-node/fetch": "0.1.1",
"@whatwg-node/fetch": "0.2.2",
"@changesets/apply-release-plan": "6.0.0",
"graphql": "16.5.0",
"@types/react": "17.0.39",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { TypedEvent } from '@graphql-yoga/typed-event-target'
import Redis from 'ioredis-mock'
import { createRedisEventTarget } from '../src'
import { Event, EventTarget } from '@whatwg-node/fetch'

describe('createRedisEventTarget', () => {
it('can listen to a simple publish', (done) => {
Expand Down
6 changes: 1 addition & 5 deletions packages/event-target/redis-event-target/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ import type {
TypedEventTarget,
EventAPI,
} from '@graphql-yoga/typed-event-target'
import { Event, EventTarget } from '@whatwg-node/fetch'
import type { Redis, Cluster } from 'ioredis'

export type CreateRedisEventTargetArgs = {
publishClient: Redis | Cluster
subscribeClient: Redis | Cluster
/**
* Event and EventTarget implementation.
* Providing this is mandatory for a Node.js versions below 16.
*/
event?: EventAPI
}

export function createRedisEventTarget<TEvent extends Event>(
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-yoga/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@graphql-tools/schema": "^8.5.0",
"@graphql-tools/utils": "^8.8.0",
"@graphql-yoga/subscription": "^2.2.2",
"@whatwg-node/fetch": "^0.1.1",
"@whatwg-node/fetch": "^0.2.2",
"@whatwg-node/server": "^0.0.3",
"dset": "^3.1.1",
"graphql-config": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/apq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"access": "public"
},
"dependencies": {
"@whatwg-node/fetch": "^0.1.1",
"@whatwg-node/fetch": "^0.2.2",
"tiny-lru": "^8.0.2"
},
"peerDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6492,10 +6492,10 @@
"@webassemblyjs/ast" "1.11.1"
"@xtuc/long" "4.2.2"

"@whatwg-node/fetch@0.1.1", "@whatwg-node/fetch@^0.0.2", "@whatwg-node/fetch@^0.1.1":
version "0.1.1"
resolved "https://registry.yarnpkg.com/@whatwg-node/fetch/-/fetch-0.1.1.tgz#b4c9379d52cdcdbc2ba74dcec62117c1c13685bc"
integrity sha512-SknQAeG0j+PSGLYSvR2/1OsuvkUZWlvfDbuZYQmQe6Z4I4Jbo9HFyxyj4VUgWvOVmvDcuZmMZHjnaoRUMNN6vA==
"@whatwg-node/fetch@0.2.2", "@whatwg-node/fetch@^0.0.2", "@whatwg-node/fetch@^0.2.2":
version "0.2.2"
resolved "https://registry.yarnpkg.com/@whatwg-node/fetch/-/fetch-0.2.2.tgz#0d9902c5afbeb7363006ffe16779e72eda8420e5"
integrity sha512-iM9JbFU/RNGd3skcZ2bkfjF8ZEJ1bcVuoblQ7tn951xvZQ/mkT/hqZy7l4NhdQ42Y/nptyYxk3OVJtlj9wbIqg==
dependencies:
"@peculiar/webcrypto" "^1.4.0"
abort-controller "^3.0.0"
Expand Down Expand Up @@ -10494,7 +10494,7 @@ etag@^1.8.1, etag@~1.8.1:
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=

event-target-polyfill@0.0.3, event-target-polyfill@^0.0.3:
event-target-polyfill@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/event-target-polyfill/-/event-target-polyfill-0.0.3.tgz#ed373295f3b257774b5d75afb2599331d9f3406c"
integrity sha512-ZMc6UuvmbinrCk4RzGyVmRyIsAyxMRlp4CqSrcQRO8Dy0A9ldbiRy5kdtBj4OtP7EClGdqGfIqo9JmOClMsGLQ==
Expand Down

0 comments on commit ba9e296

Please sign in to comment.