@@ -25,9 +25,9 @@ class Customers {
25
25
public static function register_connections () {
26
26
register_graphql_connection (
27
27
array (
28
- 'fromType ' => 'RootQuery ' ,
29
- 'toType ' => 'Customer ' ,
30
- 'fromFieldName ' => 'customers ' ,
28
+ 'fromType ' => 'RootQuery ' ,
29
+ 'toType ' => 'Customer ' ,
30
+ 'fromFieldName ' => 'customers ' ,
31
31
'connectionArgs ' => self ::get_connection_args (),
32
32
'resolve ' => function ( $ source , array $ args , AppContext $ context , ResolveInfo $ info ) {
33
33
$ resolver = new UserConnectionResolver ( $ source , $ args , $ context , $ info );
@@ -48,9 +48,9 @@ public static function register_connections() {
48
48
49
49
register_graphql_connection (
50
50
array (
51
- 'fromType ' => 'Coupon ' ,
52
- 'toType ' => 'Customer ' ,
53
- 'fromFieldName ' => 'usedBy ' ,
51
+ 'fromType ' => 'Coupon ' ,
52
+ 'toType ' => 'Customer ' ,
53
+ 'fromFieldName ' => 'usedBy ' ,
54
54
'connectionArgs ' => self ::get_connection_args (),
55
55
'resolve ' => function ( $ source , array $ args , AppContext $ context , ResolveInfo $ info ) {
56
56
$ resolver = new UserConnectionResolver ( $ source , $ args , $ context , $ info );
@@ -89,27 +89,27 @@ public static function should_execute() {
89
89
*/
90
90
public static function get_connection_args (): array {
91
91
return array (
92
- 'search ' => array (
92
+ 'search ' => array (
93
93
'type ' => 'String ' ,
94
94
'description ' => __ ( 'Limit results to those matching a string. ' , 'wp-graphql-woocommerce ' ),
95
95
),
96
- 'exclude ' => array (
96
+ 'exclude ' => array (
97
97
'type ' => array ( 'list_of ' => 'Int ' ),
98
98
'description ' => __ ( 'Ensure result set excludes specific IDs. ' , 'wp-graphql-woocommerce ' ),
99
99
),
100
- 'include ' => array (
100
+ 'include ' => array (
101
101
'type ' => array ( 'list_of ' => 'Int ' ),
102
102
'description ' => __ ( 'Limit result set to specific ids. ' , 'wp-graphql-woocommerce ' ),
103
103
),
104
- 'email ' => array (
104
+ 'email ' => array (
105
105
'type ' => 'String ' ,
106
106
'description ' => __ ( 'Limit result set to resources with a specific email. ' , 'wp-graphql-woocommerce ' ),
107
107
),
108
- 'orderby ' => array (
108
+ 'orderby ' => array (
109
109
'type ' => 'CustomerConnectionOrderbyEnum ' ,
110
110
'description ' => __ ( 'Order results by a specific field. ' , 'wp-graphql-woocommerce ' ),
111
111
),
112
- 'order ' => array (
112
+ 'order ' => array (
113
113
'type ' => 'OrderEnum ' ,
114
114
'description ' => __ ( 'Order of results. ' , 'wp-graphql-woocommerce ' ),
115
115
),
@@ -120,21 +120,20 @@ public static function get_connection_args(): array {
120
120
* This allows plugins/themes to hook in and alter what $args should be allowed to be passed
121
121
* from a GraphQL Query to the WP_Query
122
122
*
123
- * @param array $query_args The mapped query arguments.
124
- * @param array $where_args Query "where" args.
125
- * @param mixed $source The query results for a query calling this.
126
- * @param array $args All of the arguments for the query (not just the "where" args).
127
- * @param AppContext $context The AppContext object.
128
- * @param ResolveInfo $info The ResolveInfo object.
123
+ * @param array $query_args The mapped query arguments.
124
+ * @param array $where_args Query "where" args.
125
+ * @param mixed $source The query results for a query calling this.
126
+ * @param array $args All of the arguments for the query (not just the "where" args).
127
+ * @param AppContext $context The AppContext object.
128
+ * @param ResolveInfo $info The ResolveInfo object.
129
129
*
130
130
* @return array Query arguments.
131
131
*/
132
132
public static function map_input_fields_to_wp_query ( $ query_args , $ where_args , $ source , $ args , $ context , $ info ) {
133
-
134
133
$ key_mapping = array (
135
- 'search ' => 'search ' ,
136
- 'exclude ' => 'exclude ' ,
137
- 'include ' => 'include ' ,
134
+ 'search ' => 'search ' ,
135
+ 'exclude ' => 'exclude ' ,
136
+ 'include ' => 'include ' ,
138
137
);
139
138
140
139
foreach ( $ key_mapping as $ key => $ field ) {
0 commit comments