API Platform Graphql item collection normalisation (normalizeCollectionOfRelations) always return empty forcefully

I am using API-Platform with GraphQL.

In my database, I had saved value object in JSON but while querying through GraphQL it finally returns empty.

I had done the debugging and found that (in vendor directory) at ApiPlatformCoreGraphQlSerializerItemNormalizer class’s function(normalizeCollectionOfRelations) forcefully returns empty array. Below code snippt.

 * {@inheritdoc}
protected function normalizeCollectionOfRelations(PropertyMetadata $propertyMetadata, $attributeValue, string $resourceClass, ?string $format, array $context): array
    // to-many are handled directly by the GraphQL resolver
    return [];

Can anyone help me to guide so that it could avoid going in this function.

Source: Symfony4 Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *