Skip to content

Commit ff5cf8f

Browse files
committed
improve error messages
1 parent 1f98244 commit ff5cf8f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Execution/Executor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ function completeValue(ExecutionContext $executionContext, GraphQLType $returnTy
367367
);
368368
if ($completed === null) {
369369
throw new GraphQLError(
370-
"Cannot return null for non-nullable field {$info["parentType"]->getName()}.{$info["fieldName"]}."
370+
"Cannot use [null] for non-nullable field {$info["parentType"]->getName()}.{$info["fieldName"]}."
371371
);
372372
}
373373
return $completed;

src/Parser/Parser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ private function eat(string $tokenType)
824824
}
825825
if ($token["type"] !== $tokenType) {
826826
throw new UnexpectedTokenError(
827-
"Unexpected token: \"" . $token["value"] . "\", expected token of type \"$tokenType\", got tyoe \"" . $token["type"] . "\".",
827+
"Unexpected token: \"" . $token["value"] . "\", expected token of type \"$tokenType\", got type \"" . $token["type"] . "\".",
828828
$this->tokenizer->getLastLocation()
829829
);
830830
}

0 commit comments

Comments
 (0)