Skip to content

Commit

Permalink
Support graphql@16
Browse files Browse the repository at this point in the history
Drop support for graphql older than 15.7.2.

Upgrade TypeScript as required by graphql-js.

(This package is still not actively maintained but this seems like the
bare minimum.)
  • Loading branch information
glasser committed Nov 2, 2021
1 parent a5ad044 commit cb0418b
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 2.0.0

- Support `graphql@16`; do not support `graphql` older than 15.7.2.

### 1.2.1

- Fix memory leak in `withFilter`. [PR #209](https://github.com/apollographql/graphql-subscriptions/pull/209)
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"iterall": "^1.3.0"
},
"peerDependencies": {
"graphql": "^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
"graphql": "^15.7.2 || ^16.0.0"
},
"scripts": {
"clean": "rimraf dist coverage",
@@ -35,15 +35,15 @@
"@types/sinon-chai": "^3.2.4",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"graphql": "^14.0.0",
"graphql": "^16.0.0",
"istanbul": "^1.0.0-alpha.2",
"mocha": "^8.0.1",
"remap-istanbul": "^0.13.0",
"rimraf": "^3.0.2",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0",
"tslint": "^6.1.2",
"typescript": "^3.9.6"
"typescript": "^4.4.4"
},
"typings": "dist/index.d.ts",
"typescript": {
12 changes: 6 additions & 6 deletions src/test/asyncIteratorSubscription.ts
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ describe('GraphQL-JS asyncIterator', () => {
const schema = buildSchema(origIterator);


const results = await subscribe(schema, query) as AsyncIterator<ExecutionResult>;
const results = await subscribe({schema, document: query}) as AsyncIterator<ExecutionResult>;
const payload1 = results.next();

expect(isAsyncIterable(results)).to.be.true;
@@ -93,7 +93,7 @@ describe('GraphQL-JS asyncIterator', () => {
const origIterator = pubsub.asyncIterator(FIRST_EVENT);
const schema = buildSchema(origIterator, () => Promise.resolve(true));

const results = await subscribe(schema, query) as AsyncIterator<ExecutionResult>;
const results = await subscribe({schema, document: query}) as AsyncIterator<ExecutionResult>;
const payload1 = results.next();

expect(isAsyncIterable(results)).to.be.true;
@@ -133,11 +133,11 @@ describe('GraphQL-JS asyncIterator', () => {

const schema = buildSchema(origIterator, filterFn);

Promise.resolve(subscribe(schema, query)).then((results: AsyncIterableIterator<ExecutionResult>) => {
subscribe({schema, document: query}).then((results: AsyncGenerator<ExecutionResult, void, void> | ExecutionResult) => {
expect(isAsyncIterable(results)).to.be.true;

results.next();
results.return();
(results as AsyncGenerator<ExecutionResult, void, void>).next();
(results as AsyncGenerator<ExecutionResult, void, void>).return();

pubsub.publish(FIRST_EVENT, {});

@@ -159,7 +159,7 @@ describe('GraphQL-JS asyncIterator', () => {
const returnSpy = spy(origIterator, 'return');
const schema = buildSchema(origIterator);

const results = await subscribe(schema, query) as AsyncIterator<ExecutionResult>;
const results = await subscribe({schema, document: query}) as AsyncIterator<ExecutionResult>;
const end = results.return();

const r = end.then(res => {

0 comments on commit cb0418b

Please sign in to comment.