• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wp-graphql / wp-graphql-woocommerce / 23675172456

28 Mar 2026 02:10AM UTC coverage: 70.983% (-18.4%) from 89.424%
23675172456

Pull #1003

github

web-flow
Merge 05339093d into 6fb7b226f
Pull Request #1003: devops: WC email template tests, COT cursor HPOS fix, checkout account auth

71 of 81 new or added lines in 5 files covered. (87.65%)

3346 existing lines in 124 files now uncovered.

12576 of 17717 relevant lines covered (70.98%)

55.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.76
/includes/type/object/class-root-query.php
1
<?php
2
/**
3
 * Registers WooCommerce fields on the RootQuery object.
4
 *
5
 * @package WPGraphQL\WooCommerce\Type\WPObject
6
 * @since   0.6.0
7
 */
8

9
namespace WPGraphQL\WooCommerce\Type\WPObject;
10

11
use Automattic\WooCommerce\StoreApi\Utilities\ProductQueryFilters;
12
use Automattic\WooCommerce\Utilities\OrderUtil;
13
use GraphQL\Error\UserError;
14
use GraphQLRelay\Relay;
15
use WPGraphQL\AppContext;
16
use WPGraphQL\WooCommerce\Data\Factory;
17
use WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce as WooGraphQL;
18

19
/**
20
 * Class - Root_Query
21
 */
22
class Root_Query {
23
        /**
24
         * Registers WC-related root queries.
25
         *
26
         * @return void
27
         */
28
        public static function register_fields() {
29
                register_graphql_fields(
110✔
30
                        'RootQuery',
110✔
31
                        [
110✔
32
                                'cart'             => [
110✔
33
                                        'type'        => 'Cart',
110✔
34
                                        'args'        => [
110✔
35
                                                'recalculateTotals' => [
110✔
36
                                                        'type'        => 'Boolean',
110✔
37
                                                        'description' => __( 'Should cart totals be recalculated.', 'wp-graphql-woocommerce' ),
110✔
38
                                                ],
110✔
39
                                                'fees'              => [
110✔
40
                                                        'type'        => [ 'list_of' => 'FeeInput' ],
110✔
41
                                                        'description' => __( 'Fees to add to the cart.', 'wp-graphql-woocommerce' ),
110✔
42
                                                ],
110✔
43
                                        ],
110✔
44
                                        'description' => __( 'The cart object', 'wp-graphql-woocommerce' ),
110✔
45
                                        'resolve'     => static function ( $_, $args ) {
110✔
46
                                                $token_invalid = apply_filters( 'graphql_woocommerce_session_token_errors', null );
14✔
47
                                                if ( $token_invalid ) {
14✔
UNCOV
48
                                                        throw new UserError( $token_invalid );
×
49
                                                }
50

51
                                                $cart = Factory::resolve_cart();
14✔
52

53
                                                if ( ! empty( $args['fees'] ) ) {
14✔
54
                                                        $fees = $args['fees'];
1✔
55
                                                        add_action(
1✔
56
                                                                'woocommerce_cart_calculate_fees',
1✔
57
                                                                static function () use ( $fees ) {
1✔
58
                                                                        foreach ( $fees as $fee_input ) {
1✔
59
                                                                                if ( empty( $fee_input['name'] ) || empty( $fee_input['amount'] ) ) {
1✔
60
                                                                                        // TODO: Log invalid fee input.
61
                                                                                        continue;
×
62
                                                                                }
63

64
                                                                                $fee_args = [
1✔
65
                                                                                        $fee_input['name'],
1✔
66
                                                                                        $fee_input['amount'],
1✔
67
                                                                                        isset( $fee_input['taxable'] ) ? $fee_input['taxable'] : false,
1✔
68
                                                                                        isset( $fee_input['taxClass'] ) ? $fee_input['taxClass'] : '',
1✔
69
                                                                                ];
1✔
70

71
                                                                                \WC()->cart->add_fee( ...$fee_args );
1✔
72
                                                                        }
73
                                                                }
1✔
74
                                                        );
1✔
75
                                                }
76

77
                                                if ( ! empty( $args['recalculateTotals'] ) ) {
14✔
78
                                                        $cart->calculate_totals();
×
79
                                                }
80

81
                                                return $cart;
14✔
82
                                        },
110✔
83
                                ],
110✔
84
                                'cartItem'         => [
110✔
85
                                        'type'        => 'CartItem',
110✔
86
                                        'args'        => [
110✔
87
                                                'key' => [
110✔
88
                                                        'type' => [ 'non_null' => 'ID' ],
110✔
89
                                                ],
110✔
90
                                        ],
110✔
91
                                        'description' => __( 'The cart object', 'wp-graphql-woocommerce' ),
110✔
92
                                        'resolve'     => static function ( $source, array $args ) {
110✔
93
                                                $item = Factory::resolve_cart()->get_cart_item( $args['key'] );
1✔
94
                                                if ( empty( $item ) || empty( $item['key'] ) ) {
1✔
95
                                                        throw new UserError( __( 'Failed to retrieve cart item.', 'wp-graphql-woocommerce' ) );
×
96
                                                }
97

98
                                                return $item;
1✔
99
                                        },
110✔
100
                                ],
110✔
101
                                'cartFee'          => [
110✔
102
                                        'type'        => 'CartFee',
110✔
103
                                        'args'        => [
110✔
104
                                                'id' => [
110✔
105
                                                        'type' => [ 'non_null' => 'ID' ],
110✔
106
                                                ],
110✔
107
                                        ],
110✔
108
                                        'description' => __( 'The cart object', 'wp-graphql-woocommerce' ),
110✔
109
                                        'resolve'     => static function ( $source, array $args ) {
110✔
110
                                                $fees   = Factory::resolve_cart()->get_fees();
1✔
111
                                                $fee_id = $args['id'];
1✔
112

113
                                                if ( empty( $fees[ $fee_id ] ) ) {
1✔
114
                                                        throw new UserError( __( 'The ID input is invalid', 'wp-graphql-woocommerce' ) );
×
115
                                                }
116

117
                                                return $fees[ $fee_id ];
1✔
118
                                        },
110✔
119
                                ],
110✔
120
                                'coupon'           => [
110✔
121
                                        'type'        => 'Coupon',
110✔
122
                                        'description' => __( 'A coupon object', 'wp-graphql-woocommerce' ),
110✔
123
                                        'args'        => [
110✔
124
                                                'id'     => [ 'type' => [ 'non_null' => 'ID' ] ],
110✔
125
                                                'idType' => [
110✔
126
                                                        'type'        => 'CouponIdTypeEnum',
110✔
127
                                                        'description' => __( 'Type of ID being used identify coupon', 'wp-graphql-woocommerce' ),
110✔
128
                                                ],
110✔
129
                                        ],
110✔
130
                                        'resolve'     => static function ( $source, array $args, AppContext $context ) {
110✔
131
                                                $id      = isset( $args['id'] ) ? $args['id'] : null;
4✔
132
                                                $id_type = isset( $args['idType'] ) ? $args['idType'] : 'global_id';
4✔
133

134
                                                $coupon_id = null;
4✔
135
                                                switch ( $id_type ) {
136
                                                        case 'code':
4✔
137
                                                                $coupon_id = \wc_get_coupon_id_by_code( $id );
1✔
138
                                                                break;
1✔
139
                                                        case 'database_id':
4✔
140
                                                                $coupon_id = absint( $id );
1✔
141
                                                                break;
1✔
142
                                                        case 'global_id':
4✔
143
                                                        default:
144
                                                                $id_components = Relay::fromGlobalId( $args['id'] );
4✔
145
                                                                if ( empty( $id_components['id'] ) || empty( $id_components['type'] ) ) {
4✔
146
                                                                        throw new UserError( __( 'The "id" is invalid', 'wp-graphql-woocommerce' ) );
×
147
                                                                }
148
                                                                $coupon_id = absint( $id_components['id'] );
4✔
149
                                                                break;
4✔
150
                                                }
151

152
                                                // Check if user authorized to view coupon.
153
                                                /**
154
                                                 * Get coupon post type.
155
                                                 *
156
                                                 * @var \WP_Post_Type $post_type
157
                                                 */
158
                                                $post_type     = get_post_type_object( 'shop_coupon' );
4✔
159
                                                $is_authorized = current_user_can( $post_type->cap->edit_others_posts );
4✔
160
                                                if ( ! $is_authorized ) {
4✔
161
                                                        return null;
1✔
162
                                                }
163

164
                                                if ( empty( $coupon_id ) ) {
4✔
165
                                                        /* translators: %1$s: ID type, %2$s: ID value */
166
                                                        throw new UserError( sprintf( __( 'No coupon ID was found corresponding to the %1$s: %2$s', 'wp-graphql-woocommerce' ), $id_type, $id ) );
×
167
                                                }
168

169
                                                $coupon = get_post( $coupon_id );
4✔
170
                                                if ( ! is_object( $coupon ) || 'shop_coupon' !== $coupon->post_type ) {
4✔
171
                                                        /* translators: %1$s: ID type, %2$s: ID value */
172
                                                        throw new UserError( sprintf( __( 'No coupon exists with the %1$s: %2$s', 'wp-graphql-woocommerce' ), $id_type, $id ) );
×
173
                                                }
174

175
                                                return Factory::resolve_crud_object( $coupon_id, $context );
4✔
176
                                        },
110✔
177
                                ],
110✔
178
                                'customer'         => [
110✔
179
                                        'type'        => 'Customer',
110✔
180
                                        'description' => __( 'A customer object', 'wp-graphql-woocommerce' ),
110✔
181
                                        'args'        => [
110✔
182
                                                'id'         => [
110✔
183
                                                        'type'        => 'ID',
110✔
184
                                                        'description' => __( 'Get the customer by their global ID', 'wp-graphql-woocommerce' ),
110✔
185
                                                ],
110✔
186
                                                'customerId' => [
110✔
187
                                                        'type'        => 'Int',
110✔
188
                                                        'description' => __( 'Get the customer by their database ID', 'wp-graphql-woocommerce' ),
110✔
189
                                                ],
110✔
190
                                        ],
110✔
191
                                        'resolve'     => static function ( $source, array $args, AppContext $context ) {
110✔
192
                                                $current_user_id = get_current_user_id();
10✔
193

194
                                                // Default the customer to the current user.
195
                                                $customer_id = $current_user_id;
10✔
196

197
                                                // If a customer ID has been provided, resolve to that ID instead.
198
                                                if ( ! empty( $args['id'] ) ) {
10✔
199
                                                        $id_components = Relay::fromGlobalId( $args['id'] );
3✔
200
                                                        if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) {
3✔
201
                                                                throw new UserError( __( 'The ID input is invalid', 'wp-graphql-woocommerce' ) );
×
202
                                                        }
203

204
                                                        $customer_id = absint( $id_components['id'] );
3✔
205
                                                } elseif ( ! empty( $args['customerId'] ) ) {
10✔
206
                                                        $customer_id = absint( $args['customerId'] );
1✔
207
                                                }
208

209
                                                // If a user does not have the ability to list users, they can only view their own customer object.
210
                                                $unauthorized = ! empty( $customer_id )
10✔
211
                                                        && ! current_user_can( 'list_users' )
10✔
212
                                                        && $current_user_id !== $customer_id;
10✔
213
                                                if ( $unauthorized ) {
10✔
214
                                                        throw new UserError( __( 'Not authorized to access this customer', 'wp-graphql-woocommerce' ) );
2✔
215
                                                }
216

217
                                                // If we have a customer ID, resolve to that customer.
218
                                                if ( $customer_id ) {
10✔
219
                                                        return Factory::resolve_customer( $customer_id, $context );
10✔
220
                                                }
221

222
                                                // Resolve to the session customer.
223
                                                return Factory::resolve_session_customer();
1✔
224
                                        },
110✔
225
                                ],
110✔
226
                                'order'            => [
110✔
227
                                        'type'        => 'Order',
110✔
228
                                        'description' => __( 'A order object', 'wp-graphql-woocommerce' ),
110✔
229
                                        'args'        => [
110✔
230
                                                'id'     => [
110✔
231
                                                        'type'        => 'ID',
110✔
232
                                                        'description' => __( 'The ID for identifying the order', 'wp-graphql-woocommerce' ),
110✔
233
                                                ],
110✔
234
                                                'idType' => [
110✔
235
                                                        'type'        => 'OrderIdTypeEnum',
110✔
236
                                                        'description' => __( 'Type of ID being used identify order', 'wp-graphql-woocommerce' ),
110✔
237
                                                ],
110✔
238
                                        ],
110✔
239
                                        'resolve'     => static function ( $source, array $args, AppContext $context ) {
110✔
240
                                                $id      = isset( $args['id'] ) ? $args['id'] : null;
7✔
241
                                                $id_type = isset( $args['idType'] ) ? $args['idType'] : 'global_id';
7✔
242

243
                                                $order_id = null;
7✔
244
                                                switch ( $id_type ) {
245
                                                        case 'order_key':
7✔
UNCOV
246
                                                                $order_id = \wc_get_order_id_by_order_key( $id );
×
UNCOV
247
                                                                break;
×
248
                                                        case 'database_id':
7✔
249
                                                                $order_id = absint( $id );
1✔
250
                                                                break;
1✔
251
                                                        case 'global_id':
6✔
252
                                                        default:
253
                                                                $id_components = Relay::fromGlobalId( $id );
6✔
254
                                                                if ( empty( $id_components['id'] ) || empty( $id_components['type'] ) ) {
6✔
255
                                                                        throw new UserError( __( 'The "id" is invalid', 'wp-graphql-woocommerce' ) );
×
256
                                                                }
257
                                                                $order_id = absint( $id_components['id'] );
6✔
258
                                                                break;
6✔
259
                                                }
260

261
                                                if ( empty( $order_id ) ) {
7✔
262
                                                        /* translators: %1$s: ID type, %2$s: ID value */
263
                                                        throw new UserError( sprintf( __( 'No order ID was found corresponding to the %1$s: %2$s', 'wp-graphql-woocommerce' ), $id_type, $id ) );
×
264
                                                }
265

266
                                                if ( 'shop_order' !== OrderUtil::get_order_type( $order_id ) ) {
7✔
267
                                                        /* translators: %1$s: ID type, %2$s: ID value */
268
                                                        throw new UserError( sprintf( __( 'No order exists with the %1$s: %2$s', 'wp-graphql-woocommerce' ), $id_type, $id ) );
×
269
                                                }
270

271
                                                // Check if user authorized to view order.
272
                                                /**
273
                                                 * Get order post type.
274
                                                 *
275
                                                 * @var \WP_Post_Type $post_type
276
                                                 */
277
                                                $post_type     = get_post_type_object( 'shop_order' );
7✔
278
                                                $is_authorized = current_user_can( $post_type->cap->edit_others_posts );
7✔
279
                                                if ( ! $is_authorized && get_current_user_id() ) {
7✔
280
                                                        /** @var \WC_Order[] $orders */
281
                                                        $orders = wc_get_orders(
1✔
282
                                                                [
1✔
283
                                                                        'type'          => 'shop_order',
1✔
284
                                                                        'post__in'      => [ $order_id ],
1✔
285
                                                                        'customer_id'   => get_current_user_id(),
1✔
286
                                                                        'no_rows_found' => true,
1✔
287
                                                                        'return'        => 'ids',
1✔
288
                                                                ]
1✔
289
                                                        );
1✔
290

291
                                                        if ( in_array( $order_id, $orders, true ) ) {
1✔
292
                                                                $is_authorized = true;
1✔
293
                                                        }
294
                                                }
295

296
                                                // Throw if authorized to view order.
297
                                                if ( ! $is_authorized ) {
7✔
UNCOV
298
                                                        throw new UserError( __( 'Not authorized to access this order', 'wp-graphql-woocommerce' ) );
×
299
                                                }
300

301
                                                return Factory::resolve_crud_object( $order_id, $context );
7✔
302
                                        },
110✔
303
                                ],
110✔
304
                                'productVariation' => [
110✔
305
                                        'type'        => 'ProductVariation',
110✔
306
                                        'description' => __( 'A product variation object', 'wp-graphql-woocommerce' ),
110✔
307
                                        'args'        => [
110✔
308
                                                'id'     => [
110✔
309
                                                        'type'        => 'ID',
110✔
310
                                                        'description' => __( 'The ID for identifying the product variation', 'wp-graphql-woocommerce' ),
110✔
311
                                                ],
110✔
312
                                                'idType' => [
110✔
313
                                                        'type'        => 'ProductVariationIdTypeEnum',
110✔
314
                                                        'description' => __( 'Type of ID being used identify product variation', 'wp-graphql-woocommerce' ),
110✔
315
                                                ],
110✔
316
                                        ],
110✔
317
                                        'resolve'     => static function ( $source, array $args, AppContext $context ) {
110✔
318
                                                $id      = isset( $args['id'] ) ? $args['id'] : null;
3✔
319
                                                $id_type = isset( $args['idType'] ) ? $args['idType'] : 'global_id';
3✔
320

321
                                                $variation_id = null;
3✔
322
                                                switch ( $id_type ) {
323
                                                        case 'database_id':
3✔
324
                                                                $variation_id = absint( $id );
1✔
325
                                                                break;
1✔
326
                                                        case 'global_id':
2✔
327
                                                        default:
328
                                                                $id_components = Relay::fromGlobalId( $id );
2✔
329
                                                                if ( empty( $id_components['id'] ) || empty( $id_components['type'] ) ) {
2✔
330
                                                                        throw new UserError( __( 'The "id" is invalid', 'wp-graphql-woocommerce' ) );
×
331
                                                                }
332
                                                                $variation_id = absint( $id_components['id'] );
2✔
333
                                                                break;
2✔
334
                                                }
335

336
                                                if ( empty( $variation_id ) ) {
3✔
337
                                                        /* translators: %1$s: ID type, %2$s: ID value */
338
                                                        throw new UserError( sprintf( __( 'No product variation ID was found corresponding to the %1$s: %2$s', 'wp-graphql-woocommerce' ), $id_type, $id ) );
×
339
                                                }
340

341
                                                $variation = get_post( $variation_id );
3✔
342
                                                if ( ! is_object( $variation ) || 'product_variation' !== $variation->post_type ) {
3✔
343
                                                        /* translators: %1$s: ID type, %2$s: ID value */
344
                                                        throw new UserError( sprintf( __( 'No product variation exists with the %1$s: %2$s', 'wp-graphql-woocommerce' ), $id_type, $id ) );
×
345
                                                }
346

347
                                                return Factory::resolve_crud_object( $variation_id, $context );
3✔
348
                                        },
110✔
349
                                ],
110✔
350
                                'refund'           => [
110✔
351
                                        'type'        => 'Refund',
110✔
352
                                        'description' => __( 'A refund object', 'wp-graphql-woocommerce' ),
110✔
353
                                        'args'        => [
110✔
354
                                                'id'     => [
110✔
355
                                                        'type'        => [ 'non_null' => 'ID' ],
110✔
356
                                                        'description' => __( 'The ID for identifying the refund', 'wp-graphql-woocommerce' ),
110✔
357
                                                ],
110✔
358
                                                'idType' => [
110✔
359
                                                        'type'        => 'RefundIdTypeEnum',
110✔
360
                                                        'description' => __( 'Type of ID being used identify refund', 'wp-graphql-woocommerce' ),
110✔
361
                                                ],
110✔
362
                                        ],
110✔
363
                                        'resolve'     => static function ( $source, array $args, AppContext $context ) {
110✔
364
                                                $id      = isset( $args['id'] ) ? $args['id'] : null;
1✔
365
                                                $id_type = isset( $args['idType'] ) ? $args['idType'] : 'global_id';
1✔
366

367
                                                $refund_id = null;
1✔
368
                                                switch ( $id_type ) {
369
                                                        case 'database_id':
1✔
UNCOV
370
                                                                $refund_id = absint( $id );
×
UNCOV
371
                                                                break;
×
372
                                                        case 'global_id':
1✔
373
                                                        default:
374
                                                                $id_components = Relay::fromGlobalId( $id );
1✔
375
                                                                if ( empty( $id_components['id'] ) || empty( $id_components['type'] ) ) {
1✔
376
                                                                        throw new UserError( __( 'The "id" is invalid', 'wp-graphql-woocommerce' ) );
×
377
                                                                }
378
                                                                $refund_id = absint( $id_components['id'] );
1✔
379
                                                                break;
1✔
380
                                                }
381

382
                                                if ( empty( $refund_id ) ) {
1✔
383
                                                        /* translators: %1$s: ID type, %2$s: ID value */
384
                                                        throw new UserError( sprintf( __( 'No refund ID was found corresponding to the %1$s: %2$s', 'wp-graphql-woocommerce' ), $id_type, $id ) );
×
385
                                                }
386

387
                                                if ( 'shop_order_refund' !== OrderUtil::get_order_type( $refund_id ) ) {
1✔
388
                                                        /* translators: %1$s: ID type, %2$s: ID value */
389
                                                        throw new UserError( sprintf( __( 'No refund exists with the %1$s: %2$s', 'wp-graphql-woocommerce' ), $id_type, $id ) );
×
390
                                                }
391

392
                                                // Check if user authorized to view order.
393
                                                /**
394
                                                 * Get refund post type.
395
                                                 *
396
                                                 * @var \WP_Post_Type $post_type
397
                                                 */
398
                                                $post_type     = get_post_type_object( 'shop_order_refund' );
1✔
399
                                                $is_authorized = current_user_can( $post_type->cap->edit_others_posts );
1✔
400
                                                if ( get_current_user_id() ) {
1✔
401
                                                        $refund = \wc_get_order( $refund_id );
1✔
402
                                                        if ( ! is_object( $refund ) || ! is_a( $refund, \WC_Order_Refund::class ) ) {
1✔
403
                                                                throw new UserError( __( 'Failed to retrieve refund', 'wp-graphql-woocommerce' ) );
×
404
                                                        }
405
                                                        $order_id = $refund->get_parent_id();
1✔
406

407
                                                        /** @var \WC_Order[] $orders */
408
                                                        $orders = wc_get_orders(
1✔
409
                                                                [
1✔
410
                                                                        'type'          => 'shop_order',
1✔
411
                                                                        'post__in'      => [ $order_id ],
1✔
412
                                                                        'customer_id'   => get_current_user_id(),
1✔
413
                                                                        'no_rows_found' => true,
1✔
414
                                                                        'return'        => 'ids',
1✔
415
                                                                ]
1✔
416
                                                        );
1✔
417

418
                                                        if ( in_array( $order_id, $orders, true ) ) {
1✔
419
                                                                $is_authorized = true;
1✔
420
                                                        }
421
                                                }//end if
422

423
                                                // Throw if authorized to view refund.
424
                                                if ( ! $is_authorized ) {
1✔
UNCOV
425
                                                        throw new UserError( __( 'Not authorized to access this refund', 'wp-graphql-woocommerce' ) );
×
426
                                                }
427

428
                                                return Factory::resolve_crud_object( $refund_id, $context );
1✔
429
                                        },
110✔
430
                                ],
110✔
431
                                'shippingMethod'   => [
110✔
432
                                        'type'        => 'ShippingMethod',
110✔
433
                                        'description' => __( 'A shipping method object', 'wp-graphql-woocommerce' ),
110✔
434
                                        'args'        => [
110✔
435
                                                'id'     => [
110✔
436
                                                        'type'        => 'ID',
110✔
437
                                                        'description' => __( 'The ID for identifying the shipping method', 'wp-graphql-woocommerce' ),
110✔
438
                                                ],
110✔
439
                                                'idType' => [
110✔
440
                                                        'type'        => 'ShippingMethodIdTypeEnum',
110✔
441
                                                        'description' => __( 'Type of ID being used identify product variation', 'wp-graphql-woocommerce' ),
110✔
442
                                                ],
110✔
443
                                        ],
110✔
444
                                        'resolve'     => static function ( $source, array $args ) {
110✔
UNCOV
445
                                                if ( ! \wc_rest_check_manager_permissions( 'shipping_methods', 'read' ) ) {
×
UNCOV
446
                                                        throw new UserError( __( 'Sorry, you cannot view shipping methods.', 'wp-graphql-woocommerce' ), \rest_authorization_required_code() );
×
447
                                                }
448

UNCOV
449
                                                $id      = isset( $args['id'] ) ? $args['id'] : null;
×
UNCOV
450
                                                $id_type = isset( $args['idType'] ) ? $args['idType'] : 'global_id';
×
451

UNCOV
452
                                                $method_id = null;
×
453
                                                switch ( $id_type ) {
UNCOV
454
                                                        case 'database_id':
×
UNCOV
455
                                                                $method_id = $id;
×
UNCOV
456
                                                                break;
×
UNCOV
457
                                                        case 'global_id':
×
458
                                                        default:
UNCOV
459
                                                                $id_components = Relay::fromGlobalId( $id );
×
UNCOV
460
                                                                if ( empty( $id_components['id'] ) || empty( $id_components['type'] ) ) {
×
461
                                                                        throw new UserError( __( 'The "id" is invalid', 'wp-graphql-woocommerce' ) );
×
462
                                                                }
UNCOV
463
                                                                $method_id = $id_components['id'];
×
UNCOV
464
                                                                break;
×
465
                                                }
466

UNCOV
467
                                                return Factory::resolve_shipping_method( $method_id );
×
468
                                        },
110✔
469
                                ],
110✔
470
                                'shippingZone'     => [
110✔
471
                                        'type'        => 'ShippingZone',
110✔
472
                                        'description' => __( 'A shipping zone object', 'wp-graphql-woocommerce' ),
110✔
473
                                        'args'        => [
110✔
474
                                                'id'     => [
110✔
475
                                                        'type'        => 'ID',
110✔
476
                                                        'description' => __( 'The ID for identifying the shipping zone', 'wp-graphql-woocommerce' ),
110✔
477
                                                ],
110✔
478
                                                'idType' => [
110✔
479
                                                        'type'        => 'ShippingZoneIdTypeEnum',
110✔
480
                                                        'description' => __( 'Type of ID being used identify shipping zone', 'wp-graphql-woocommerce' ),
110✔
481
                                                ],
110✔
482
                                        ],
110✔
483
                                        'resolve'     => static function ( $source, array $args, AppContext $context ) {
110✔
UNCOV
484
                                                if ( ! \wc_shipping_enabled() ) {
×
485
                                                        throw new UserError( __( 'Shipping is disabled.', 'wp-graphql-woocommerce' ), 404 );
×
486
                                                }
487

UNCOV
488
                                                if ( ! \wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
×
UNCOV
489
                                                        throw new UserError( __( 'Permission denied.', 'wp-graphql-woocommerce' ), \rest_authorization_required_code() );
×
490
                                                }
491

UNCOV
492
                                                $id      = isset( $args['id'] ) ? $args['id'] : null;
×
UNCOV
493
                                                $id_type = isset( $args['idType'] ) ? $args['idType'] : 'global_id';
×
494

UNCOV
495
                                                $zone_id = null;
×
496
                                                switch ( $id_type ) {
UNCOV
497
                                                        case 'database_id':
×
498
                                                                $zone_id = $id;
×
499
                                                                break;
×
UNCOV
500
                                                        case 'global_id':
×
501
                                                        default:
UNCOV
502
                                                                $id_components = Relay::fromGlobalId( $id );
×
UNCOV
503
                                                                if ( empty( $id_components['id'] ) || empty( $id_components['type'] ) ) {
×
504
                                                                        throw new UserError( __( 'The "id" is invalid', 'wp-graphql-woocommerce' ) );
×
505
                                                                }
UNCOV
506
                                                                $zone_id = $id_components['id'];
×
UNCOV
507
                                                                break;
×
508
                                                }
509

UNCOV
510
                                                return $context->get_loader( 'shipping_zone' )->load( $zone_id );
×
511
                                        },
110✔
512
                                ],
110✔
513
                                'taxRate'          => [
110✔
514
                                        'type'        => 'TaxRate',
110✔
515
                                        'description' => __( 'A tax rate object', 'wp-graphql-woocommerce' ),
110✔
516
                                        'args'        => [
110✔
517
                                                'id'     => [
110✔
518
                                                        'type'        => 'ID',
110✔
519
                                                        'description' => __( 'The ID for identifying the tax rate', 'wp-graphql-woocommerce' ),
110✔
520
                                                ],
110✔
521
                                                'idType' => [
110✔
522
                                                        'type'        => 'TaxRateIdTypeEnum',
110✔
523
                                                        'description' => __( 'Type of ID being used identify tax rate', 'wp-graphql-woocommerce' ),
110✔
524
                                                ],
110✔
525
                                        ],
110✔
526
                                        'resolve'     => static function ( $source, array $args, AppContext $context ) {
110✔
UNCOV
527
                                                if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
×
UNCOV
528
                                                        throw new UserError( __( 'Sorry, you cannot view tax rates.', 'wp-graphql-woocommerce' ), \rest_authorization_required_code() );
×
529
                                                }
UNCOV
530
                                                $id      = isset( $args['id'] ) ? $args['id'] : null;
×
UNCOV
531
                                                $id_type = isset( $args['idType'] ) ? $args['idType'] : 'global_id';
×
532

UNCOV
533
                                                $rate_id = null;
×
534
                                                switch ( $id_type ) {
UNCOV
535
                                                        case 'database_id':
×
UNCOV
536
                                                                $rate_id = absint( $id );
×
UNCOV
537
                                                                break;
×
UNCOV
538
                                                        case 'global_id':
×
539
                                                        default:
UNCOV
540
                                                                $id_components = Relay::fromGlobalId( $id );
×
UNCOV
541
                                                                if ( empty( $id_components['id'] ) || empty( $id_components['type'] ) ) {
×
542
                                                                        throw new UserError( __( 'The "id" is invalid', 'wp-graphql-woocommerce' ) );
×
543
                                                                }
UNCOV
544
                                                                $rate_id = absint( $id_components['id'] );
×
UNCOV
545
                                                                break;
×
546
                                                }
547

UNCOV
548
                                                return Factory::resolve_tax_rate( $rate_id, $context );
×
549
                                        },
110✔
550
                                ],
110✔
551
                                'countries'        => [
110✔
552
                                        'type'        => [ 'list_of' => 'CountriesEnum' ],
110✔
553
                                        'description' => __( 'Countries', 'wp-graphql-woocommerce' ),
110✔
554
                                        'resolve'     => static function () {
110✔
UNCOV
555
                                                $wc_countries = new \WC_Countries();
×
UNCOV
556
                                                $countries    = $wc_countries->get_countries();
×
557

UNCOV
558
                                                return array_keys( $countries );
×
559
                                        },
110✔
560
                                ],
110✔
561
                                'allowedCountries' => [
110✔
562
                                        'type'        => [ 'list_of' => 'CountriesEnum' ],
110✔
563
                                        'description' => __( 'Countries that the store sells to', 'wp-graphql-woocommerce' ),
110✔
564
                                        'resolve'     => static function () {
110✔
UNCOV
565
                                                $wc_countries = new \WC_Countries();
×
UNCOV
566
                                                $countries    = $wc_countries->get_allowed_countries();
×
567

UNCOV
568
                                                return array_keys( $countries );
×
569
                                        },
110✔
570
                                ],
110✔
571
                                'countryStates'    => [
110✔
572
                                        'type'        => [ 'list_of' => 'CountryState' ],
110✔
573
                                        'args'        => [
110✔
574
                                                'country' => [
110✔
575
                                                        'type'        => [ 'non_null' => 'CountriesEnum' ],
110✔
576
                                                        'description' => __( 'Target country', 'wp-graphql-woocommerce' ),
110✔
577
                                                ],
110✔
578
                                        ],
110✔
579
                                        'description' => __( 'Countries that the store sells to', 'wp-graphql-woocommerce' ),
110✔
580
                                        'resolve'     => static function ( $_, $args ) {
110✔
UNCOV
581
                                                $country      = $args['country'];
×
UNCOV
582
                                                $wc_countries = new \WC_Countries();
×
UNCOV
583
                                                $states       = $wc_countries->get_shipping_country_states();
×
584

UNCOV
585
                                                if ( ! empty( $states ) && ! empty( $states[ $country ] ) ) {
×
UNCOV
586
                                                        $formatted_states = [];
×
UNCOV
587
                                                        foreach ( $states[ $country ] as $code => $name ) {
×
UNCOV
588
                                                                $formatted_states[] = compact( 'name', 'code' );
×
589
                                                        }
590

UNCOV
591
                                                        return $formatted_states;
×
592
                                                }
593

594
                                                return [];
×
595
                                        },
110✔
596
                                ],
110✔
597
                                'wcSettingGroups'  => [
110✔
598
                                        'type'        => [ 'list_of' => 'WCSettingGroup' ],
110✔
599
                                        'description' => __( 'WooCommerce setting groups', 'wp-graphql-woocommerce' ),
110✔
600
                                        'resolve'     => static function () {
110✔
UNCOV
601
                                                if ( ! \wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
×
UNCOV
602
                                                        throw new UserError( __( 'Sorry, you cannot view settings.', 'wp-graphql-woocommerce' ) );
×
603
                                                }
604

UNCOV
605
                                                $groups = apply_filters( 'woocommerce_settings_groups', [] ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
×
UNCOV
606
                                                return array_values( $groups );
×
607
                                        },
110✔
608
                                ],
110✔
609
                                'wcSettings'       => [
110✔
610
                                        'type'        => [ 'list_of' => 'WCSetting' ],
110✔
611
                                        'description' => __( 'WooCommerce settings for a specific group', 'wp-graphql-woocommerce' ),
110✔
612
                                        'args'        => [
110✔
613
                                                'group' => [
110✔
614
                                                        'type'        => [ 'non_null' => 'String' ],
110✔
615
                                                        'description' => __( 'Settings group ID', 'wp-graphql-woocommerce' ),
110✔
616
                                                ],
110✔
617
                                        ],
110✔
618
                                        'resolve'     => static function ( $_, $args ) {
110✔
UNCOV
619
                                                if ( ! \wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
×
620
                                                        throw new UserError( __( 'Sorry, you cannot view settings.', 'wp-graphql-woocommerce' ) );
×
621
                                                }
622

UNCOV
623
                                                $controller = new \WC_REST_Setting_Options_Controller();
×
UNCOV
624
                                                $settings   = $controller->get_group_settings( $args['group'] );
×
625

UNCOV
626
                                                if ( is_wp_error( $settings ) ) {
×
UNCOV
627
                                                        throw new UserError( $settings->get_error_message() );
×
628
                                                }
629

UNCOV
630
                                                return $settings;
×
631
                                        },
110✔
632
                                ],
110✔
633
                                'collectionStats'  => [
110✔
634
                                        'type'        => 'CollectionStats',
110✔
635
                                        'args'        => [
110✔
636
                                                'calculatePriceRange'        => [
110✔
637
                                                        'type'        => 'Boolean',
110✔
638
                                                        'description' => __( 'If true, calculates the minimum and maximum product prices for the collection.', 'wp-graphql-woocommerce' ),
110✔
639
                                                ],
110✔
640
                                                'calculateRatingCounts'      => [
110✔
641
                                                        'type'        => 'Boolean',
110✔
642
                                                        'description' => __( 'If true, calculates rating counts for products in the collection.', 'wp-graphql-woocommerce' ),
110✔
643
                                                ],
110✔
644
                                                'calculateStockStatusCounts' => [
110✔
645
                                                        'type'        => 'Boolean',
110✔
646
                                                        'description' => __( 'If true, calculates stock counts for products in the collection.', 'wp-graphql-woocommerce' ),
110✔
647
                                                ],
110✔
648
                                                'taxonomies'                 => [
110✔
649
                                                        'type' => [ 'list_of' => 'CollectionStatsQueryInput' ],
110✔
650
                                                ],
110✔
651
                                                'where'                      => [
110✔
652
                                                        'type' => 'CollectionStatsWhereArgs',
110✔
653
                                                ],
110✔
654
                                        ],
110✔
655
                                        'description' => __( 'Statistics for a product taxonomy query', 'wp-graphql-woocommerce' ),
110✔
656
                                        'resolve'     => static function ( $_, $args ) {
110✔
657
                                                /** @var array<string, mixed> $data */
658
                                                $data    = [
4✔
659
                                                        'min_price'           => null,
4✔
660
                                                        'max_price'           => null,
4✔
661
                                                        'attribute_counts'    => null,
4✔
662
                                                        'stock_status_counts' => null,
4✔
663
                                                        'rating_counts'       => null,
4✔
664
                                                ];
4✔
665
                                                $filters = new ProductQueryFilters();
4✔
666

667
                                                // Process client-side filters.
668
                                                $request = Collection_Stats_Type::prepare_rest_request( $args['where'] ?? [] );
4✔
669

670
                                                // Format taxonomies.
671
                                                if ( ! empty( $args['taxonomies'] ) ) {
4✔
672
                                                        $calculate_attribute_counts = [];
4✔
673
                                                        foreach ( $args['taxonomies'] as $attribute_to_count ) {
4✔
674
                                                                $attribute = [ 'taxonomy' => $attribute_to_count['taxonomy'] ];
4✔
675
                                                                // Set the query type.
676
                                                                if ( ! empty( $attribute_to_count['relation'] ) ) {
4✔
677
                                                                        $attribute['query_type'] = strtolower( $attribute_to_count['relation'] );
4✔
678
                                                                }
679

680
                                                                // Add the attribute to the list of attributes to count.
681
                                                                $calculate_attribute_counts[] = $attribute;
4✔
682
                                                        }
683

684
                                                        // Set the attribute counts to calculate.
685
                                                        $request->set_param( 'calculate_attribute_counts', $calculate_attribute_counts );
4✔
686
                                                }
687

688
                                                $request->set_param( 'calculate_price_range', $args['calculatePriceRange'] ?? false );
4✔
689
                                                $request->set_param( 'calculate_stock_status_counts', $args['calculateStockStatusCounts'] ?? false );
4✔
690
                                                $request->set_param( 'calculate_rating_counts', $args['calculateRatingCounts'] ?? false );
4✔
691

692
                                                if ( ! empty( $request['calculate_price_range'] ) ) {
4✔
693
                                                        /**
694
                                                         * A Rest request object for external filtering
695
                                                         *
696
                                                         * @var \WP_REST_Request $filter_request
697
                                                         */
698
                                                        $filter_request = clone $request;
1✔
699
                                                        $filter_request->set_param( 'min_price', null );
1✔
700
                                                        $filter_request->set_param( 'max_price', null );
1✔
701

702
                                                        /** @var object{min_price: float, max_price: float} */
703
                                                        $price_results     = $filters->get_filtered_price( $filter_request );
1✔
704
                                                        $data['min_price'] = $price_results->min_price;
1✔
705
                                                        $data['max_price'] = $price_results->max_price;
1✔
706
                                                }
707

708
                                                if ( ! empty( $request['calculate_stock_status_counts'] ) ) {
4✔
709
                                                        /**
710
                                                         * A Rest request object for external filtering
711
                                                         *
712
                                                         * @var \WP_REST_Request $filter_request
713
                                                         */
714
                                                        $filter_request = clone $request;
1✔
715
                                                        $counts         = $filters->get_stock_status_counts( $filter_request );
1✔
716

717
                                                        $data['stock_status_counts'] = [];
1✔
718

719
                                                        foreach ( $counts as $key => $value ) {
1✔
720
                                                                $data['stock_status_counts'][] = (object) [
1✔
721
                                                                        'status' => $key,
1✔
722
                                                                        'count'  => $value,
1✔
723
                                                                ];
1✔
724
                                                        }
725
                                                }
726

727
                                                if ( ! empty( $request['calculate_attribute_counts'] ) ) {
4✔
728
                                                        $taxonomy__or_queries  = [];
4✔
729
                                                        $taxonomy__and_queries = [];
4✔
730
                                                        foreach ( $request['calculate_attribute_counts'] as $attributes_to_count ) {
4✔
731
                                                                if ( ! isset( $attributes_to_count['taxonomy'] ) ) {
4✔
732
                                                                        continue;
×
733
                                                                }
734

735
                                                                if ( empty( $attributes_to_count['query_type'] ) || 'or' === $attributes_to_count['query_type'] ) {
4✔
736
                                                                        $taxonomy__or_queries[] = $attributes_to_count['taxonomy'];
3✔
737
                                                                } else {
738
                                                                        $taxonomy__and_queries[] = $attributes_to_count['taxonomy'];
3✔
739
                                                                }
740
                                                        }
741

742
                                                        $data['attribute_counts'] = [];
4✔
743
                                                        if ( ! empty( $taxonomy__or_queries ) ) {
4✔
744
                                                                foreach ( $taxonomy__or_queries as $taxonomy ) {
3✔
745
                                                                        /**
746
                                                                         * A Rest request object for external filtering
747
                                                                         *
748
                                                                         * @var \WP_REST_Request $filter_request
749
                                                                         */
750
                                                                        $filter_request    = clone $request;
3✔
751
                                                                        $filter_attributes = $filter_request->get_param( 'attributes' );
3✔
752

753
                                                                        if ( ! empty( $filter_attributes ) ) {
3✔
754
                                                                                $filter_attributes = array_filter(
×
755
                                                                                        $filter_attributes,
×
756
                                                                                        static function ( $query ) use ( $taxonomy ) {
×
757
                                                                                                return $query['attribute'] !== $taxonomy;
×
758
                                                                                        }
×
759
                                                                                );
×
760
                                                                        }
761

762
                                                                        $filter_request->set_param( 'attributes', $filter_attributes );
3✔
763
                                                                        $counts = $filters->get_attribute_counts( $filter_request, [ $taxonomy ] );
3✔
764

765
                                                                        $data['attribute_counts'][ $taxonomy ] = [];
3✔
766
                                                                        foreach ( $counts as $key => $value ) {
3✔
767
                                                                                $data['attribute_counts'][ $taxonomy ][] = (object) [
3✔
768
                                                                                        'taxonomy' => $taxonomy,
3✔
769
                                                                                        'termId'   => $key,
3✔
770
                                                                                        'count'    => $value,
3✔
771
                                                                                ];
3✔
772
                                                                        }
773
                                                                }
774
                                                        }
775

776
                                                        if ( ! empty( $taxonomy__and_queries ) ) {
4✔
777
                                                                $counts = $filters->get_attribute_counts( $request, $taxonomy__and_queries );
3✔
778

779
                                                                foreach ( $taxonomy__and_queries as $taxonomy ) {
3✔
780
                                                                        $data['attribute_counts'][ $taxonomy ] = [];
3✔
781
                                                                        foreach ( $counts as $key => $value ) {
3✔
782
                                                                                $data['attribute_counts'][ $taxonomy ][] = (object) [
3✔
783
                                                                                        'taxonomy' => $taxonomy,
3✔
784
                                                                                        'termId'   => $key,
3✔
785
                                                                                        'count'    => $value,
3✔
786
                                                                                ];
3✔
787
                                                                        }
788
                                                                }
789
                                                        }
790
                                                }
791

792
                                                if ( ! empty( $request['calculate_rating_counts'] ) ) {
4✔
793
                                                        /**
794
                                                         * A Rest request object for external filtering
795
                                                         *
796
                                                         * @var \WP_REST_Request $filter_request
797
                                                         */
798
                                                        $filter_request        = clone $request;
4✔
799
                                                        $counts                = $filters->get_rating_counts( $filter_request );
4✔
800
                                                        $data['rating_counts'] = [];
4✔
801

802
                                                        foreach ( $counts as $key => $value ) {
4✔
803
                                                                $data['rating_counts'][] = (object) [
×
804
                                                                        'rating' => $key,
×
805
                                                                        'count'  => $value,
×
806
                                                                ];
×
807
                                                        }
808
                                                }
809

810
                                                return $data;
4✔
811
                                        },
110✔
812
                                ],
110✔
813
                        ]
110✔
814
                );
110✔
815

816
                // Product queries.
817
                $unsupported_type_enabled = woographql_setting( 'enable_unsupported_product_type', 'off' );
110✔
818

819
                $product_type_keys = array_keys( WooGraphQL::get_enabled_product_types() );
110✔
820
                if ( 'on' === $unsupported_type_enabled ) {
110✔
UNCOV
821
                        $product_type_keys[] = 'unsupported';
×
822
                }
823

824
                $product_type_keys = apply_filters( 'woographql_register_product_queries', $product_type_keys );
110✔
825

826
                $product_types = WooGraphQL::get_enabled_product_types();
110✔
827
                if ( 'on' === $unsupported_type_enabled ) {
110✔
UNCOV
828
                        $product_types['unsupported'] = WooGraphQL::get_supported_product_type();
×
829
                }
830

831
                foreach ( $product_type_keys as $type_key ) {
110✔
832
                        $field_name = "{$type_key}Product";
110✔
833
                        $type_name  = $product_types[ $type_key ] ?? null;
110✔
834

835
                        if ( empty( $type_name ) ) {
110✔
836
                                continue;
×
837
                        }
838

839
                        register_graphql_field(
110✔
840
                                'RootQuery',
110✔
841
                                $field_name,
110✔
842
                                [
110✔
843
                                        'type'              => $type_name,
110✔
844
                                        /* translators: Product type slug */
845
                                        'description'       => sprintf( __( 'A %s product object', 'wp-graphql-woocommerce' ), $type_key ),
110✔
846
                                        'deprecationReason' => 'Use "product" instead.',
110✔
847
                                        'args'              => [
110✔
848
                                                'id'     => [
110✔
849
                                                        'type'        => 'ID',
110✔
850
                                                        'description' => sprintf(
110✔
851
                                                                /* translators: %s: product type */
852
                                                                __( 'The ID for identifying the %s product', 'wp-graphql-woocommerce' ),
110✔
853
                                                                $type_name
110✔
854
                                                        ),
110✔
855
                                                ],
110✔
856
                                                'idType' => [
110✔
857
                                                        'type'        => 'ProductIdTypeEnum',
110✔
858
                                                        'description' => __( 'Type of ID being used identify product', 'wp-graphql-woocommerce' ),
110✔
859
                                                ],
110✔
860
                                        ],
110✔
861
                                        'resolve'           => static function ( $source, array $args, AppContext $context ) use ( $type_key, $unsupported_type_enabled ) {
110✔
UNCOV
862
                                                $id      = isset( $args['id'] ) ? $args['id'] : null;
×
UNCOV
863
                                                $id_type = isset( $args['idType'] ) ? $args['idType'] : 'global_id';
×
864

UNCOV
865
                                                $product_id = null;
×
866
                                                switch ( $id_type ) {
UNCOV
867
                                                        case 'sku':
×
868
                                                                $product_id = \wc_get_product_id_by_sku( $id );
×
869
                                                                break;
×
UNCOV
870
                                                        case 'slug':
×
871
                                                                $post       = get_page_by_path( $id, OBJECT, 'product' );
×
872
                                                                $product_id = ! empty( $post ) ? absint( $post->ID ) : 0;
×
873
                                                                break;
×
UNCOV
874
                                                        case 'database_id':
×
875
                                                                $product_id = absint( $id );
×
876
                                                                break;
×
UNCOV
877
                                                        case 'global_id':
×
878
                                                        default:
UNCOV
879
                                                                $id_components = Relay::fromGlobalId( $id );
×
UNCOV
880
                                                                if ( empty( $id_components['id'] ) || empty( $id_components['type'] ) ) {
×
881
                                                                        throw new UserError( __( 'The "id" is invalid', 'wp-graphql-woocommerce' ) );
×
882
                                                                }
UNCOV
883
                                                                $product_id = absint( $id_components['id'] );
×
UNCOV
884
                                                                break;
×
885
                                                }
886

UNCOV
887
                                                if ( empty( $product_id ) ) {
×
888
                                                        /* translators: %1$s: ID type, %2$s: ID value */
889
                                                        throw new UserError( sprintf( __( 'No product ID was found corresponding to the %1$s: %2$s', 'wp-graphql-woocommerce' ), $id_type, $product_id ) );
×
890
                                                }
891

UNCOV
892
                                                if ( \WC()->product_factory->get_product_type( $product_id ) !== $type_key && 'off' === $unsupported_type_enabled ) {
×
893
                                                        /* translators: Invalid product type message %1$s: Product ID, %2$s: Product type */
894
                                                        throw new UserError( sprintf( __( 'This product of ID %1$s is not a %2$s product', 'wp-graphql-woocommerce' ), $product_id, $type_key ) );
×
895
                                                }
896

UNCOV
897
                                                $product = get_post( $product_id );
×
UNCOV
898
                                                if ( ! is_object( $product ) || 'product' !== $product->post_type ) {
×
899
                                                        /* translators: %1$s: ID type, %2$s: ID value */
900
                                                        throw new UserError( sprintf( __( 'No product exists with the %1$s: %2$s', 'wp-graphql-woocommerce' ), $id_type, $product_id ) );
×
901
                                                }
902

UNCOV
903
                                                return Factory::resolve_crud_object( $product_id, $context );
×
904
                                        },
110✔
905
                                ]
110✔
906
                        );
110✔
907
                }//end foreach
908
        }
909
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc