@@ -34,14 +34,22 @@ function graphql_api_graphql_api_info() {
3434 'name ' => 'field_item_file ' ,
3535 'fields ' => function () {
3636 $ schema = graphql_api ();
37- return $ schema ->getInterfaceType ('file ' )->getFields () + [
37+ $ file_type = $ schema ->getObjectType ('file_file ' );
38+ if (module_exists ('file_entity ' )) {
39+ $ file_type = $ schema ->getInterfaceType ('file ' );
40+ }
41+ return [
3842 'description ' => [
3943 'type ' => Type::string (),
4044 'description ' => t ('Alt ' )
4145 ],
4246 'display ' => [
4347 'type ' => Type::string (),
4448 'description ' => t ('Display ' )
49+ ],
50+ 'file ' => [
51+ 'type ' => $ file_type ,
52+ 'description ' => t ('File ' )
4553 ]
4654 ];
4755 }
@@ -50,7 +58,11 @@ function graphql_api_graphql_api_info() {
5058 'name ' => 'field_item_image ' ,
5159 'fields ' => function () {
5260 $ schema = graphql_api ();
53- return $ schema ->getInterfaceType ('file ' )->getFields () + [
61+ $ file_type = $ schema ->getObjectType ('file_file ' );
62+ if (module_exists ('file_entity ' )) {
63+ $ file_type = $ schema ->getInterfaceType ('file ' );
64+ }
65+ return [
5466 'description ' => [
5567 'type ' => Type::string (),
5668 'description ' => t ('Alt ' )
@@ -66,6 +78,18 @@ function graphql_api_graphql_api_info() {
6678 'title ' => [
6779 'type ' => Type::string (),
6880 'description ' => t ('Title ' )
81+ ],
82+ 'width ' => [
83+ 'type ' => Type::float (),
84+ 'description ' => t ('Width ' )
85+ ],
86+ 'height ' => [
87+ 'type ' => Type::float (),
88+ 'description ' => t ('Height ' )
89+ ],
90+ 'file ' => [
91+ 'type ' => $ file_type ,
92+ 'description ' => t ('File ' )
6993 ]
7094 ];
7195 }
0 commit comments