Skip to content

Commit

Permalink
Fix validation of handler arg in @connection validation
Browse files Browse the repository at this point in the history
Reviewed By: kassens

Differential Revision: D20335962

fbshipit-source-id: b0c844f8fab2edcb15e5c3e9ebfa3bbd58e1406e
  • Loading branch information
Juan Tejada authored and facebook-github-bot committed Mar 9, 2020
1 parent 5ec8737 commit 62a10d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/relay-compiler/transforms/ConnectionTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ function buildConnectionArguments(
filters: literalFilters,
} = getLiteralArgumentValues(connectionDirective.args);
if (handler != null && typeof handler !== 'string') {
const handleArg = connectionDirective.args.find(arg => arg.name === 'key');
const handleArg = connectionDirective.args.find(
arg => arg.name === 'handler',
);
throw createUserError(
`Expected the ${HANDLER} argument to @${connectionDirective.name} to ` +
`be a string literal for field ${field.name}.`,
Expand Down

0 comments on commit 62a10d8

Please sign in to comment.