Skip to content

Commit 64a7e8b

Browse files
committed
downcast from Type! to Type
1 parent 92e3f08 commit 64a7e8b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

source/graphql/validation/schemabased.d

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class SchemaValidator(Schema) : Visitor {
255255
}
256256

257257
override void enter(const(Argument) arg) {
258-
import std.algorithm.searching : find;
258+
import std.algorithm.searching : find, endsWith;
259259
const argName = arg.name.value;
260260
if(this.directiveStack.empty) {
261261
const parent = this.schemaStack[$ - 2];
@@ -286,7 +286,10 @@ class SchemaValidator(Schema) : Visitor {
286286

287287
string typeStr = astTypeToString(*varType);
288288
enforce!VariableInputTypeMismatch(
289-
argElem.front[Constants.typenameOrig] == typeStr,
289+
argElem.front[Constants.typenameOrig] == typeStr
290+
|| (typeStr.endsWith("!")
291+
&& typeStr[0 .. $ - 1] == argElem.front[Constants.typenameOrig])
292+
,
290293
format("Variable type '%s' does not match argument type '%s'"
291294
, argElem.front[Constants.typenameOrig], typeStr));
292295
}

0 commit comments

Comments
 (0)