Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Jan 17, 2025
1 parent 70e249b commit d654b5f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/nestjs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,22 +270,22 @@ export class YogaDriver<
`);
}

config['graphql-ws'].onSubscribe = async (ctx, msg) => {
config['graphql-ws'].onSubscribe = async (ctx, _id, params) => {
const { schema, execute, subscribe, contextFactory, parse, validate } =
this.yoga.getEnveloped({
...ctx,
// @ts-expect-error context extra is from graphql-ws/lib/use/ws
req: ctx.extra.request,
// @ts-expect-error context extra is from graphql-ws/lib/use/ws
socket: ctx.extra.socket,
params: msg.payload,
params,
});

const args = {
schema,
operationName: msg.payload.operationName,
document: parse(msg.payload.query),
variableValues: msg.payload.variables,
operationName: params.operationName,
document: parse(params.query),
variableValues: params.variables,
contextValue: await contextFactory({ execute, subscribe }),
};

Expand Down

0 comments on commit d654b5f

Please sign in to comment.