Skip to content

Commit

Permalink
Repair lint/prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugome committed May 4, 2020
1 parent 7eaac26 commit 566371f
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions src/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,17 @@ module.exports = function(mixinOptions) {
visibility: "private",
tracing: {
tags: {
params: [
"socket.upgradeReq.url"
]
params: ["socket.upgradeReq.url"],
},
spanName: ctx => `UPGRADE ${ctx.params.socket.upgradeReq}`
spanName: ctx => `UPGRADE ${ctx.params.socket.upgradeReq.url}`,
},
handler(ctx) {
const { socket, connectionParams } = ctx.params
const { socket, connectionParams } = ctx.params;
socket.$ctx = ctx;
socket.$params = { body: connectionParams, query: socket.upgradeReq.query };
return connectionParams;
}
}
},
},
},

events: {
Expand Down Expand Up @@ -329,7 +327,8 @@ module.exports = function(mixinOptions) {
: false
)
: () => this.pubsub.asyncIterator(tags),
resolve: async (payload, params, { ctx }) => ctx.call(actionName, { ...params, payload })
resolve: (payload, params, { ctx }) =>
ctx.call(actionName, { ...params, payload }),
};
},

Expand Down Expand Up @@ -606,22 +605,24 @@ module.exports = function(mixinOptions) {
schema,
..._.defaultsDeep({}, mixinOptions.serverOptions, {
context: ({ req, connection }) => ({
...(req ? {
ctx: req.$ctx,
service: req.$service,
params: req.$params,
} : {
ctx: connection.context.socket.$ctx,
service: connection.context.$service,
params: connection.context.socket.$params,
}),
...(req
? {
ctx: req.$ctx,
service: req.$service,
params: req.$params,
}
: {
ctx: connection.context.socket.$ctx,
service: connection.context.$service,
params: connection.context.socket.$params,
}),
dataLoaders: new Map(), // create an empty map to load DataLoader instances into
}),
subscriptions: {
onConnect: async (connectionParams, socket) => ({
...await this.actions.ws({ connectionParams, socket }),
...(await this.actions.ws({ connectionParams, socket })),
socket,
$service: this
$service: this,
}),
},
}),
Expand Down

0 comments on commit 566371f

Please sign in to comment.