Skip to content

Commit a880d96

Browse files
authored
[GraphQL] add support for Symfony Serializer's @SerializedName metadata (#3455)
* [GraphQL] add support for Symfony Serializer's `@SerializedName` metadata * SerializedName used in message in ValidationExceptionNormalizer * Revert "SerializedName used in message in ValidationExceptionNormalizer" This reverts commit 51bc4ba.
1 parent 6e3a259 commit a880d96

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/GraphQl/Type/FieldsBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public function getResourceObjectTypeFields(?string $resourceClass, ResourceMeta
224224
}
225225

226226
if ($fieldConfiguration = $this->getResourceFieldConfiguration($property, $propertyMetadata->getDescription(), $propertyMetadata->getAttribute('deprecation_reason', ''), $propertyType, $resourceClass, $input, $queryName, $mutationName, $subscriptionName, $depth)) {
227-
$fields['id' === $property ? '_id' : $this->normalizePropertyName($property)] = $fieldConfiguration;
227+
$fields['id' === $property ? '_id' : $this->normalizePropertyName($property, $resourceClass)] = $fieldConfiguration;
228228
}
229229
}
230230
}
@@ -493,8 +493,8 @@ private function convertType(Type $type, bool $input, ?string $queryName, ?strin
493493
: GraphQLType::nonNull($graphqlType);
494494
}
495495

496-
private function normalizePropertyName(string $property): string
496+
private function normalizePropertyName(string $property, string $resourceClass): string
497497
{
498-
return null !== $this->nameConverter ? $this->nameConverter->normalize($property) : $property;
498+
return null !== $this->nameConverter ? $this->nameConverter->normalize($property, $resourceClass) : $property;
499499
}
500500
}

0 commit comments

Comments
 (0)