API平台Graphql项集合规范化(normalizeCollectionOfRelations)始终强制返回空

API平台Graphql项集合规范化(normalizeCollectionOfRelations)始终强制返回空,graphql,symfony4,api-platform.com,Graphql,Symfony4,Api Platform.com,我正在使用带有GraphQL的API平台 在我的数据库中,我将value对象保存在JSON中,但在通过GraphQL进行查询时,它最终返回空值 我已经完成了调试,发现(在供应商目录中)apiplate\Core\GraphQl\Serializer\ItemNormalizer类的函数(normalizeCollectionOfRelations)强制返回空数组。下面是代码snippt /** * {@inheritdoc} */ protected function normalizeCo

我正在使用带有GraphQL的API平台

在我的数据库中,我将value对象保存在JSON中,但在通过GraphQL进行查询时,它最终返回空值

我已经完成了调试,发现(在供应商目录中)apiplate\Core\GraphQl\Serializer\ItemNormalizer类的函数(normalizeCollectionOfRelations)强制返回空数组。下面是代码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 [];
}
有谁能帮我指导一下,这样它就可以避免进入这个功能