File tree 1 file changed +19
-0
lines changed
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
2942
2942
2943
2943
For handling the upload of multiple files, iterate over `$context['args']['input']['files']`.
2944
2944
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
+
2945
2964
# ## Using the `createMediaObject` Mutation
2946
2965
2947
2966
Following 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