@@ -23,18 +23,18 @@ public static function register_type() {
2323 'description ' => __ ( 'Script enqueued by the CMS ' , 'wp-graphql ' ),
2424 'interfaces ' => [ 'Node ' , 'EnqueuedAsset ' ],
2525 'fields ' => [
26- 'id ' => [
26+ 'id ' => [
2727 'type ' => [ 'non_null ' => 'ID ' ],
2828 'description ' => __ ( 'The global ID of the enqueued script ' , 'wp-graphql ' ),
2929 'resolve ' => static function ( $ asset ) {
3030 return isset ( $ asset ->handle ) ? Relay::toGlobalId ( 'enqueued_script ' , $ asset ->handle ) : null ;
3131 },
3232 ],
33- 'dependencies ' => [
33+ 'dependencies ' => [
3434 'type ' => [ 'list_of ' => 'EnqueuedScript ' ],
3535 'description ' => __ ( 'Dependencies needed to use this asset ' , 'wp-graphql ' ),
3636 ],
37- 'extraData ' => [
37+ 'extraData ' => [
3838 'type ' => 'String ' ,
3939 'description ' => __ ( 'Extra data supplied to the enqueued script ' , 'wp-graphql ' ),
4040 'resolve ' => static function ( \_WP_Dependency $ script ) {
@@ -45,7 +45,7 @@ public static function register_type() {
4545 return $ script ->extra ['data ' ];
4646 },
4747 ],
48- 'strategy ' => [
48+ 'strategy ' => [
4949 'type ' => 'ScriptLoadingStrategyEnum ' ,
5050 'description ' => __ ( 'The loading strategy to use on the script tag ' , 'wp-graphql ' ),
5151 'resolve ' => static function ( \_WP_Dependency $ script ) {
@@ -56,18 +56,14 @@ public static function register_type() {
5656 return $ script ->extra ['strategy ' ];
5757 },
5858 ],
59- 'location ' => [
59+ 'groupLocation ' => [
6060 'type ' => 'ScriptLoadingGroupEnum ' ,
6161 'description ' => __ ( 'The location where this script should be loaded ' , 'wp-graphql ' ),
6262 'resolve ' => static function ( \_WP_Dependency $ script ) {
63- if ( ! isset ( $ script ->extra ['group ' ] ) ) {
64- return 0 ;
65- }
66-
67- return absint ( $ script ->extra ['group ' ] );
63+ return isset ( $ script ->extra ['group ' ] ) ? (int ) $ script ->extra ['group ' ] : 0 ;
6864 },
6965 ],
70- 'version ' => [
66+ 'version ' => [
7167 'description ' => __ ( 'The version of the enqueued script ' , 'wp-graphql ' ),
7268 'resolve ' => static function ( \_WP_Dependency $ script ) {
7369 /** @var \WP_Scripts $wp_scripts */
0 commit comments