File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2942,6 +2942,25 @@ final class CreateMediaObjectResolver implements MutationResolverInterface
29422942
29432943For handling the upload of multiple files, iterate over `$context['args']['input']['files']`.
29442944
2945+ # ## Normalization of MediaObjects
2946+
2947+ In the constructor of the `MediaObjectNormalizer`, the graphql Normalizer must be injected :
2948+
2949+ ` ` ` PHP
2950+ <?php
2951+ // api/src/Serializer/MediaObjectNormalizer.php
2952+
2953+ ...
2954+
2955+ public function __construct(
2956+ #[Autowire(service: 'api_platform.graphql.normalizer.item')]
2957+ private readonly NormalizerInterface $normalizer,
2958+ private readonly StorageInterface $storage
2959+ ) {}
2960+
2961+ ...
2962+ ` ` `
2963+
29452964# ## Using the `createMediaObject` Mutation
29462965
29472966Following the specification, the upload must be done with a `multipart/form-data` content type.
You can’t perform that action at this time.
0 commit comments