Skip to content

Commit

Permalink
docs(graphql): make object property access safe (#4858)
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli authored Oct 12, 2023
1 parent 9a8f5a7 commit a53c5ba
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ queries and mutations.
export const hasOperationName = (req, operationName) => {
const { body } = req
return (
body.hasOwnProperty('operationName') && body.operationName === operationName
Object.prototype.hasOwnProperty.call(body, 'operationName') &&
body.operationName === operationName
)
}

Expand Down

0 comments on commit a53c5ba

Please sign in to comment.