@@ -34,14 +34,22 @@ function graphql_api_graphql_api_info() {
34
34
'name ' => 'field_item_file ' ,
35
35
'fields ' => function () {
36
36
$ 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 [
38
42
'description ' => [
39
43
'type ' => Type::string (),
40
44
'description ' => t ('Alt ' )
41
45
],
42
46
'display ' => [
43
47
'type ' => Type::string (),
44
48
'description ' => t ('Display ' )
49
+ ],
50
+ 'file ' => [
51
+ 'type ' => $ file_type ,
52
+ 'description ' => t ('File ' )
45
53
]
46
54
];
47
55
}
@@ -50,7 +58,11 @@ function graphql_api_graphql_api_info() {
50
58
'name ' => 'field_item_image ' ,
51
59
'fields ' => function () {
52
60
$ 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 [
54
66
'description ' => [
55
67
'type ' => Type::string (),
56
68
'description ' => t ('Alt ' )
@@ -66,6 +78,18 @@ function graphql_api_graphql_api_info() {
66
78
'title ' => [
67
79
'type ' => Type::string (),
68
80
'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 ' )
69
93
]
70
94
];
71
95
}
0 commit comments