diff --git a/src/Utils/Value.php b/src/Utils/Value.php index 2bb053c..a427d3e 100644 --- a/src/Utils/Value.php +++ b/src/Utils/Value.php @@ -199,7 +199,7 @@ class Value } $suggestions = Utils::suggestionList( - $fieldName, + (string) $fieldName, array_keys($fields) ); $didYouMean = $suggestions diff --git a/tests/Regression/Issue467Test.php b/tests/Regression/Issue467Test.php new file mode 100644 index 0000000..988b4ac --- /dev/null +++ b/tests/Regression/Issue467Test.php @@ -0,0 +1,45 @@ + ['my message']]; + + $schema = BuildSchema::build($schemaStr); + $result = GraphQL::executeQuery($schema, $query, null, null, $variables); + + $expectedError = 'Variable "$msg" got invalid value ["my message"]; Field "0" is not defined by type MsgInput.'; + self::assertCount(1, $result->errors); + self::assertEquals($expectedError, $result->errors[0]->getMessage()); + } +}