|
22 | 22 | use ApiPlatform\Metadata\GraphQl\Operation;
|
23 | 23 | use ApiPlatform\Metadata\GraphQl\Query;
|
24 | 24 | use ApiPlatform\Metadata\GraphQl\Subscription;
|
| 25 | +use ApiPlatform\Metadata\InflectorInterface; |
25 | 26 | use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
|
26 | 27 | use ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface;
|
27 | 28 | use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
|
@@ -50,7 +51,7 @@ final class FieldsBuilder implements FieldsBuilderInterface, FieldsBuilderEnumIn
|
50 | 51 | {
|
51 | 52 | private readonly ContextAwareTypeBuilderInterface|TypeBuilderEnumInterface|TypeBuilderInterface $typeBuilder;
|
52 | 53 |
|
53 |
| - public function __construct(private readonly PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, private readonly PropertyMetadataFactoryInterface $propertyMetadataFactory, private readonly ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, private readonly ResourceClassResolverInterface $resourceClassResolver, private readonly TypesContainerInterface $typesContainer, ContextAwareTypeBuilderInterface|TypeBuilderEnumInterface|TypeBuilderInterface $typeBuilder, private readonly TypeConverterInterface $typeConverter, private readonly ResolverFactoryInterface $itemResolverFactory, private readonly ?ResolverFactoryInterface $collectionResolverFactory, private readonly ?ResolverFactoryInterface $itemMutationResolverFactory, private readonly ?ResolverFactoryInterface $itemSubscriptionResolverFactory, private readonly ContainerInterface $filterLocator, private readonly Pagination $pagination, private readonly ?NameConverterInterface $nameConverter, private readonly string $nestingSeparator) |
| 54 | + public function __construct(private readonly PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, private readonly PropertyMetadataFactoryInterface $propertyMetadataFactory, private readonly ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, private readonly ResourceClassResolverInterface $resourceClassResolver, private readonly TypesContainerInterface $typesContainer, ContextAwareTypeBuilderInterface|TypeBuilderEnumInterface|TypeBuilderInterface $typeBuilder, private readonly TypeConverterInterface $typeConverter, private readonly ResolverFactoryInterface $itemResolverFactory, private readonly ?ResolverFactoryInterface $collectionResolverFactory, private readonly ?ResolverFactoryInterface $itemMutationResolverFactory, private readonly ?ResolverFactoryInterface $itemSubscriptionResolverFactory, private readonly ContainerInterface $filterLocator, private readonly Pagination $pagination, private readonly ?NameConverterInterface $nameConverter, private readonly string $nestingSeparator, private readonly ?InflectorInterface $inflector = new Inflector()) |
54 | 55 | {
|
55 | 56 | if ($typeBuilder instanceof TypeBuilderInterface) {
|
56 | 57 | @trigger_error(sprintf('$typeBuilder argument of FieldsBuilder implementing "%s" is deprecated since API Platform 3.1. It has to implement "%s" instead.', TypeBuilderInterface::class, TypeBuilderEnumInterface::class), \E_USER_DEPRECATED);
|
@@ -113,7 +114,7 @@ public function getCollectionQueryFields(string $resourceClass, Operation $opera
|
113 | 114 | $extraArgs = $this->resolveResourceArgs($operation->getExtraArgs() ?? [], $operation);
|
114 | 115 | $configuration['args'] = $args ?: $configuration['args'] ?? $fieldConfiguration['args'] + $extraArgs;
|
115 | 116 |
|
116 |
| - return [Inflector::pluralize($fieldName) => array_merge($fieldConfiguration, $configuration)]; |
| 117 | + return [$this->inflector->pluralize($fieldName) => array_merge($fieldConfiguration, $configuration)]; |
117 | 118 | }
|
118 | 119 |
|
119 | 120 | return [];
|
|
0 commit comments