Skip to content

Commit

Permalink
update graphql-ws
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Aug 24, 2024
1 parent 4ef45f6 commit 576d017
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion examples/graphiql-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@graphiql/react": "^0.26.1",
"graphiql": "^3.7.0",
"graphql": "^16.8.1",
"graphql-ws": "^5.5.5",
"graphql-ws": "^5.16.0",
"react": "^18.2.0",
"regenerator-runtime": "^0.13.9"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/monaco-graphql-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@graphiql/toolkit": "^0.11.0",
"graphql": "^16.8.1",
"graphql-ws": "^5.5.5",
"graphql-ws": "^5.16.0",
"jsonc-parser": "^3.2.0",
"marked": "^4.2.12",
"monaco-editor": "^0.39.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"devDependencies": {
"graphql": "^17.0.0-alpha.7",
"graphql-ws": "^5.5.5",
"graphql-ws": "^5.16.0",
"graphql-sse": "^2.5.3",
"isomorphic-fetch": "^3.0.0",
"subscriptions-transport-ws": "0.11.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/test/e2e-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ app.use('/graphql/stream', (req, res, next) => {
});

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

Expand Down
26 changes: 13 additions & 13 deletions packages/graphiql/test/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

const graphql = require('graphql');

const {
GraphQLSchema,
GraphQLObjectType,
Expand All @@ -22,7 +25,12 @@ const {
GraphQLStreamDirective,
specifiedDirectives,
version,
} = require('graphql');
} = graphql;

const directives =
parseInt(version, 10) > 16
? [...specifiedDirectives, GraphQLDeferDirective, GraphQLStreamDirective]
: specifiedDirectives;

// Test Schema
const TestEnum = new GraphQLEnumType({
Expand Down Expand Up @@ -374,7 +382,7 @@ const TestSubscriptionType = new GraphQLObjectType({
},
async *subscribe(root, args) {
for (const hi of ['Hi', 'Bonjour', 'Hola', 'Ciao', 'Zdravo']) {
if (args.delay) {
if (args?.delay) {
await sleep(args.delay);
}
yield { message: hi };
Expand All @@ -384,20 +392,12 @@ const TestSubscriptionType = new GraphQLObjectType({
},
});

const schemaConfig = {
const myTestSchema = new GraphQLSchema({
query: TestType,
mutation: TestMutationType,
subscription: TestSubscriptionType,
description: 'This is a test schema for GraphiQL',
};

exports.schema = new GraphQLSchema({
...schemaConfig,
directives:
parseInt(version, 10) > 16
? [...specifiedDirectives, GraphQLDeferDirective, GraphQLStreamDirective]
: specifiedDirectives,
directives,
});

// Same schema but without defer/stream directives
exports.sseSchema = new GraphQLSchema(schemaConfig);
exports.schema = myTestSchema;
2 changes: 1 addition & 1 deletion packages/vscode-graphql-execution/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"graphql": "^16.8.1 || ^17.0.0-alpha.2",
"graphql-config": "5.0.3",
"graphql-tag": "2.12.6",
"graphql-ws": "5.10.0",
"graphql-ws": "5.16.0",
"svelte": "^4.1.1",
"svelte2tsx": "^0.6.16",
"ws": "8.17.1",
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10517,16 +10517,16 @@ [email protected]:
dependencies:
tslib "^2.1.0"

[email protected]:
version "5.10.0"
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.10.0.tgz#3fb47a4e809e0d2e7c197f1bca754fa9f31b940e"
integrity sha512-ewbPzHQdRZgNCPDH9Yr6xccSeZfk3fmpO/AGGGg4KkM5gc6oAOJQ10Oui1EqprhVOyRbOll9bw2qAkOiOwfTag==

[email protected], graphql-ws@^5.5.5:
[email protected]:
version "5.14.0"
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.14.0.tgz#766f249f3974fc2c48fae0d1fb20c2c4c79cd591"
integrity sha512-itrUTQZP/TgswR4GSSYuwWUzrE/w5GhbwM2GX3ic2U7aw33jgEsayfIlvaj7/GcIvZgNMzsPTrE5hqPuFUiE5g==

[email protected], graphql-ws@^5.16.0:
version "5.16.0"
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.16.0.tgz#849efe02f384b4332109329be01d74c345842729"
integrity sha512-Ju2RCU2dQMgSKtArPbEtsK5gNLnsQyTNIo/T7cZNp96niC1x0KdJNZV0TIoilceBPQwfb5itrGl8pkFeOUMl4A==

[email protected], graphql@^16.8.1, "graphql@^16.8.1 || ^17.0.0-alpha.2", graphql@^17.0.0-alpha.7:
version "17.0.0-alpha.7"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-17.0.0-alpha.7.tgz#707e7457d7ed5316a8d7940f78809a2eb5854383"
Expand Down

0 comments on commit 576d017

Please sign in to comment.