Skip to content

Commit 576d017

Browse files
committed
update graphql-ws
1 parent 4ef45f6 commit 576d017

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

examples/graphiql-webpack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@graphiql/react": "^0.26.1",
1616
"graphiql": "^3.7.0",
1717
"graphql": "^16.8.1",
18-
"graphql-ws": "^5.5.5",
18+
"graphql-ws": "^5.16.0",
1919
"react": "^18.2.0",
2020
"regenerator-runtime": "^0.13.9"
2121
},

examples/monaco-graphql-nextjs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"@graphiql/toolkit": "^0.11.0",
1313
"graphql": "^16.8.1",
14-
"graphql-ws": "^5.5.5",
14+
"graphql-ws": "^5.16.0",
1515
"jsonc-parser": "^3.2.0",
1616
"marked": "^4.2.12",
1717
"monaco-editor": "^0.39.0",

packages/graphiql-toolkit/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"graphql": "^17.0.0-alpha.7",
34-
"graphql-ws": "^5.5.5",
34+
"graphql-ws": "^5.16.0",
3535
"graphql-sse": "^2.5.3",
3636
"isomorphic-fetch": "^3.0.0",
3737
"subscriptions-transport-ws": "0.11.0",

packages/graphiql/test/e2e-server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ app.use('/graphql/stream', (req, res, next) => {
6767
});
6868

6969
// Create the GraphQL over SSE handler
70-
const sseHandler = createHandler({ schema: sseSchema });
70+
const sseHandler = createHandler({ schema, execute: customExecute });
7171
// Serve all methods on `/graphql/stream`
7272
app.use('/graphql/stream', sseHandler);
7373

packages/graphiql/test/schema.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* This source code is licensed under the MIT license found in the
66
* LICENSE file in the root directory of this source tree.
77
*/
8+
9+
const graphql = require('graphql');
10+
811
const {
912
GraphQLSchema,
1013
GraphQLObjectType,
@@ -22,7 +25,12 @@ const {
2225
GraphQLStreamDirective,
2326
specifiedDirectives,
2427
version,
25-
} = require('graphql');
28+
} = graphql;
29+
30+
const directives =
31+
parseInt(version, 10) > 16
32+
? [...specifiedDirectives, GraphQLDeferDirective, GraphQLStreamDirective]
33+
: specifiedDirectives;
2634

2735
// Test Schema
2836
const TestEnum = new GraphQLEnumType({
@@ -374,7 +382,7 @@ const TestSubscriptionType = new GraphQLObjectType({
374382
},
375383
async *subscribe(root, args) {
376384
for (const hi of ['Hi', 'Bonjour', 'Hola', 'Ciao', 'Zdravo']) {
377-
if (args.delay) {
385+
if (args?.delay) {
378386
await sleep(args.delay);
379387
}
380388
yield { message: hi };
@@ -384,20 +392,12 @@ const TestSubscriptionType = new GraphQLObjectType({
384392
},
385393
});
386394

387-
const schemaConfig = {
395+
const myTestSchema = new GraphQLSchema({
388396
query: TestType,
389397
mutation: TestMutationType,
390398
subscription: TestSubscriptionType,
391399
description: 'This is a test schema for GraphiQL',
392-
};
393-
394-
exports.schema = new GraphQLSchema({
395-
...schemaConfig,
396-
directives:
397-
parseInt(version, 10) > 16
398-
? [...specifiedDirectives, GraphQLDeferDirective, GraphQLStreamDirective]
399-
: specifiedDirectives,
400+
directives,
400401
});
401402

402-
// Same schema but without defer/stream directives
403-
exports.sseSchema = new GraphQLSchema(schemaConfig);
403+
exports.schema = myTestSchema;

packages/vscode-graphql-execution/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"graphql": "^16.8.1 || ^17.0.0-alpha.2",
113113
"graphql-config": "5.0.3",
114114
"graphql-tag": "2.12.6",
115-
"graphql-ws": "5.10.0",
115+
"graphql-ws": "5.16.0",
116116
"svelte": "^4.1.1",
117117
"svelte2tsx": "^0.6.16",
118118
"ws": "8.17.1",

yarn.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -10517,16 +10517,16 @@ [email protected]:
1051710517
dependencies:
1051810518
tslib "^2.1.0"
1051910519

10520-
10521-
version "5.10.0"
10522-
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.10.0.tgz#3fb47a4e809e0d2e7c197f1bca754fa9f31b940e"
10523-
integrity sha512-ewbPzHQdRZgNCPDH9Yr6xccSeZfk3fmpO/AGGGg4KkM5gc6oAOJQ10Oui1EqprhVOyRbOll9bw2qAkOiOwfTag==
10524-
10525-
[email protected], graphql-ws@^5.5.5:
10520+
1052610521
version "5.14.0"
1052710522
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.14.0.tgz#766f249f3974fc2c48fae0d1fb20c2c4c79cd591"
1052810523
integrity sha512-itrUTQZP/TgswR4GSSYuwWUzrE/w5GhbwM2GX3ic2U7aw33jgEsayfIlvaj7/GcIvZgNMzsPTrE5hqPuFUiE5g==
1052910524

10525+
[email protected], graphql-ws@^5.16.0:
10526+
version "5.16.0"
10527+
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.16.0.tgz#849efe02f384b4332109329be01d74c345842729"
10528+
integrity sha512-Ju2RCU2dQMgSKtArPbEtsK5gNLnsQyTNIo/T7cZNp96niC1x0KdJNZV0TIoilceBPQwfb5itrGl8pkFeOUMl4A==
10529+
1053010530
[email protected], graphql@^16.8.1, "graphql@^16.8.1 || ^17.0.0-alpha.2", graphql@^17.0.0-alpha.7:
1053110531
version "17.0.0-alpha.7"
1053210532
resolved "https://registry.yarnpkg.com/graphql/-/graphql-17.0.0-alpha.7.tgz#707e7457d7ed5316a8d7940f78809a2eb5854383"

0 commit comments

Comments
 (0)