Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/Transformer/ArgumentsTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ private function getType(string $type, ResolveInfo $info): Type
private function populateObject(Type $type, $data, bool $multiple, ResolveInfo $info)
{
if (null === $data) {
if ($type instanceof InputObjectType) {
return $this->getTypeClassInstance($type->name) ?: null;
}
return $data;
}

Expand Down Expand Up @@ -129,9 +132,9 @@ private function populateObject(Type $type, $data, bool $multiple, ResolveInfo $
}

return $instance;
} else {
return $data;
}

return $data;
}

/**
Expand Down Expand Up @@ -170,9 +173,9 @@ public function getInstanceAndValidate(string $argType, $data, ResolveInfo $info

if (\count($errors) > 0) {
throw new InvalidArgumentError($argName, $errors);
} else {
return $result;
}

return $result;
}

/**
Expand Down