Skip to content

Commit ae13bca

Browse files
committed
String type (IRI) if depth > 0 (= subresource) for input
1 parent 9e5713f commit ae13bca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GraphQl/Type/SchemaBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ private function convertType(Type $type, bool $input = false, string $mutationNa
341341
$graphqlType = $this->graphqlTypes['#iterable'];
342342
break;
343343
case Type::BUILTIN_TYPE_OBJECT:
344-
if (is_a($type->getClassName(), \DateTimeInterface::class, true)) {
344+
if (($input && $depth > 0) || is_a($type->getClassName(), \DateTimeInterface::class, true)) {
345345
$graphqlType = GraphQLType::string();
346346
break;
347347
}

0 commit comments

Comments
 (0)