File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -2942,6 +2942,26 @@ 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 injected Normalizer must be replaced with the one from the one
2948+ from the graphql-namespace :
2949+
2950+ ` ` ` PHP
2951+ <?php
2952+ // api/src/Serializer/MediaObjectNormalizer.php
2953+
2954+ ...
2955+
2956+ public function __construct(
2957+ #[Autowire(service: 'api_platform.graphql.normalizer.item')]
2958+ private readonly NormalizerInterface $normalizer,
2959+ private readonly StorageInterface $storage
2960+ ) {}
2961+
2962+ ...
2963+ ` ` `
2964+
29452965# ## Using the `createMediaObject` Mutation
29462966
29472967Following 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