Skip to content

Commit

Permalink
nullを返す場合は追加しない
Browse files Browse the repository at this point in the history
  • Loading branch information
chihiro-adachi committed Sep 20, 2023
1 parent 132224a commit 4f5402c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions GraphQL/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ private function createObjectType($className)
return $acc;
}

$acc[$prop->getName()] = [
'type' => $this->convertPhpTypeToType($prop->getType()),
];
$type = $this->convertPhpTypeToType($prop->getType());
if ($type) {
$acc[$prop->getName()] = $type;
}

return $acc;
}, $fields);
Expand Down

0 comments on commit 4f5402c

Please sign in to comment.