diff --git a/.changeset/tender-lions-arrive.md b/.changeset/tender-lions-arrive.md new file mode 100644 index 00000000000..576ba2bc4e4 --- /dev/null +++ b/.changeset/tender-lions-arrive.md @@ -0,0 +1,6 @@ +--- +'@graphql-tools/executor-graphql-ws': patch +--- + +changed the order how the configuration is given into the graphql-wsclient and prevent the +overwriting of the parameters diff --git a/packages/executors/graphql-ws/src/index.ts b/packages/executors/graphql-ws/src/index.ts index cdb2a29b2a3..a32b964cc93 100644 --- a/packages/executors/graphql-ws/src/index.ts +++ b/packages/executors/graphql-ws/src/index.ts @@ -25,6 +25,7 @@ export function buildGraphQLWSExecutor( graphqlWSClient = clientOptionsOrClient; } else { graphqlWSClient = createClient({ + ...clientOptionsOrClient, webSocketImpl: WebSocket, lazy: true, connectionParams: () => { @@ -34,7 +35,6 @@ export function buildGraphQLWSExecutor( : clientOptionsOrClient.connectionParams) || {}; return Object.assign(optionsConnectionParams, executorConnectionParams); }, - ...clientOptionsOrClient, }); if (clientOptionsOrClient.onClient) { clientOptionsOrClient.onClient(graphqlWSClient);