From 2bf39a81e151918f0af0161c414785454da30254 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Wed, 14 Aug 2019 12:07:45 -0400 Subject: [PATCH] Pass `argumentName`, not `fieldName`, to type validations. --- graphql_server/CHANGELOG.md | 1 + graphql_server/lib/graphql_server.dart | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/graphql_server/CHANGELOG.md b/graphql_server/CHANGELOG.md index f6a1d166..b8d17ebc 100644 --- a/graphql_server/CHANGELOG.md +++ b/graphql_server/CHANGELOG.md @@ -3,6 +3,7 @@ * Now that variables are `InputValueContext` descendants, handle them the same way as other values in `coerceArgumentValues`. TLDR - Removed now-obsolete, variable-specific logic in `coerceArgumentValues`. +* Pass `argumentName`, not `fieldName`, to type validations. # 1.0.1 * Fix a bug where `globalVariables` were not being properly passed diff --git a/graphql_server/lib/graphql_server.dart b/graphql_server/lib/graphql_server.dart index 2ff007ff..b8355dae 100644 --- a/graphql_server/lib/graphql_server.dart +++ b/graphql_server/lib/graphql_server.dart @@ -416,7 +416,7 @@ class GraphQL { } else { try { var validation = argumentType.validate( - fieldName, argumentValue.value.computeValue(variableValues)); + argumentName, argumentValue.value.computeValue(variableValues)); if (!validation.successful) { var errors = [