@@ -15,15 +15,15 @@ public static function register_type() {
1515 [
1616 'description ' => __ ( 'File details for a Media Item ' , 'wp-graphql ' ),
1717 'fields ' => [
18- 'width ' => [
18+ 'width ' => [
1919 'type ' => 'Int ' ,
2020 'description ' => __ ( 'The width of the mediaItem ' , 'wp-graphql ' ),
2121 ],
22- 'height ' => [
22+ 'height ' => [
2323 'type ' => 'Int ' ,
2424 'description ' => __ ( 'The height of the mediaItem ' , 'wp-graphql ' ),
2525 ],
26- 'file ' => [
26+ 'file ' => [
2727 'type ' => 'String ' ,
2828 'description ' => __ ( 'The filename of the mediaItem ' , 'wp-graphql ' ),
2929 'resolve ' => static function ( $ media_details ) {
@@ -35,17 +35,17 @@ public static function register_type() {
3535 'description ' => __ ( 'The path to the mediaItem relative to the uploads directory ' , 'wp-graphql ' ),
3636 'resolve ' => static function ( $ media_details ) {
3737 // Get the upload directory info
38- $ upload_dir = wp_upload_dir ();
38+ $ upload_dir = wp_upload_dir ();
3939 $ relative_upload_path = wp_make_link_relative ( $ upload_dir ['baseurl ' ] );
40-
40+
4141 if ( ! empty ( $ media_details ['file ' ] ) ) {
4242 return path_join ( $ relative_upload_path , $ media_details ['file ' ] );
4343 }
44-
44+
4545 return null ;
4646 },
4747 ],
48- 'sizes ' => [
48+ 'sizes ' => [
4949 'type ' => [
5050 'list_of ' => 'MediaSize ' ,
5151 ],
@@ -87,7 +87,7 @@ public static function register_type() {
8787 return ! empty ( $ sizes ) ? $ sizes : null ;
8888 },
8989 ],
90- 'meta ' => [
90+ 'meta ' => [
9191 'type ' => 'MediaItemMeta ' ,
9292 'description ' => __ ( 'Meta information associated with the mediaItem ' , 'wp-graphql ' ),
9393 'resolve ' => static function ( $ media_details ) {
0 commit comments