From 62e786b57cc5748eccac59814dfc8ecd0104c748 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Thu, 28 Oct 2021 16:04:48 +0200 Subject: [PATCH] fix: remove type definition from vulnerable library (#1990) --- .changeset/blue-eggs-tease.md | 6 ++++++ packages/graphiql-toolkit/src/create-fetcher/lib.ts | 7 +++---- yarn.lock | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/blue-eggs-tease.md diff --git a/.changeset/blue-eggs-tease.md b/.changeset/blue-eggs-tease.md new file mode 100644 index 00000000000..30fc0926e3b --- /dev/null +++ b/.changeset/blue-eggs-tease.md @@ -0,0 +1,6 @@ +--- +'graphiql': patch +'@graphiql/toolkit': patch +--- + +Remove type definition from `subscriptions-transport-ws` diff --git a/packages/graphiql-toolkit/src/create-fetcher/lib.ts b/packages/graphiql-toolkit/src/create-fetcher/lib.ts index 7dc431bd9af..09c19f9892d 100644 --- a/packages/graphiql-toolkit/src/create-fetcher/lib.ts +++ b/packages/graphiql-toolkit/src/create-fetcher/lib.ts @@ -1,7 +1,6 @@ import { DocumentNode, visit, GraphQLError } from 'graphql'; import { meros } from 'meros'; import { createClient, Client, ClientOptions } from 'graphql-ws'; -import { SubscriptionClient } from 'subscriptions-transport-ws'; import { isAsyncIterable, makeAsyncIterableIteratorFromSink, @@ -116,9 +115,9 @@ export const createWebsocketsFetcherFromClient = (wsClient: Client) => ( }), ); -export const createLegacyWebsocketsFetcher = ( - legacyWsClient: SubscriptionClient, -) => (graphQLParams: FetcherParams) => { +export const createLegacyWebsocketsFetcher = (legacyWsClient: { + request: (params: FetcherParams) => unknown; +}) => (graphQLParams: FetcherParams) => { const observable = legacyWsClient.request(graphQLParams); return makeAsyncIterableIteratorFromSink( // @ts-ignore diff --git a/yarn.lock b/yarn.lock index 1584f4bd7b7..31209bb3963 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3288,7 +3288,7 @@ integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== "@graphiql/toolkit@file:packages/graphiql-toolkit": - version "0.2.2" + version "0.3.0" dependencies: "@n1ru4l/push-pull-async-iterable-iterator" "^3.0.0" graphql-ws "^4.9.0" @@ -11512,15 +11512,15 @@ grapheme-splitter@^1.0.4: integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== "graphiql@file:packages/graphiql": - version "1.4.2" + version "1.4.3" dependencies: - "@graphiql/toolkit" "^0.2.0" + "@graphiql/toolkit" "^0.3.0" codemirror "^5.58.2" codemirror-graphql "^1.0.0" copy-to-clipboard "^3.2.0" dset "^3.1.0" entities "^2.0.0" - graphql-language-service "^3.1.2" + graphql-language-service "^3.1.5" markdown-it "^10.0.0" graphql-config@^3.0.2: