* Add image support for productBrand query
* chore: text-domain updated
---------
Co-authored-by: Christian Garibaldi <cgaribaldi94@gmail.com>
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
* fix: address WordPress.org plugin review feedback
- Prefix the session transaction queue transient with the plugin's
graphql_woocommerce_ namespace instead of the generic "woo_" word, to
avoid collisions (Plugin Directory: prefix data storage).
- Declare the WooCommerce dependency via the "Requires Plugins: woocommerce"
plugin header.
- Bump README.txt "Tested up to" to 7.0.
- Ship composer.json in the distributed plugin (drop it, and composer.lock,
from composer archive excludes) so the build is reproducible/reviewable.
* chore: rename plugin to "GraphQL for eCommerce" for trademark compliance
The WordPress.org plugin review flagged the display name/slug for beginning
with the "WPGraphQL" trademark (and the "WooGraphQL" portmanteau of the
WooCommerce mark), which can imply official affiliation.
- Display name (plugin header + readme title) -> "GraphQL for eCommerce".
- Slug/text domain -> "graphql-for-ecommerce" (header, all i18n string
literals, and the PHPCS WordPress.WP.I18n text_domain config).
- Update user-facing notices/errors that named the old plugin.
"WooGraphQL" remains the project's informal nickname (repo, docs, community),
just not in the WordPress.org directory's official name/slug. Internal file
names and GitHub URLs are unchanged.
* fix: keep test-only dev deps out of the committed composer.json
The committed manifest mirrors develop (lint/stan dev deps only); CI adds the
test suite deps at runtime via `composer installTestEnv`. A previous commit
captured the installTestEnv-modified composer.json, desyncing it from
composer.lock and breaking `composer install` in CI.
* chore: regenerate composer.lock (refresh dev dependencies)
Regenerate the lock from the manifest so it is in sync (fixes the CI
`composer install` failure) and refresh dependencies in the process —
firebase/php-jwt v7.0.4 -> v7.1.0 plus 11 others, with vendor-prefixed
re-strauss'd to match. Full wpunit suite passes against the updated deps
(305 tests, 835 assertions).
* chore: rename text domain in createdVia/attribution strings from #1018#1018 (createdVia + order attribution) merged into develop after the rename
commit was authored, so its new i18n strings still used the old
'wp-graphql-woocommerce' text domain. Update them to 'graphql-for-ecommerce'
to match the rename.
* fix: resolve product variation type when the node is a base Post model
A cart item's variation node can be loaded through the generic post loader (e.g. under Polylang, which doesn't manage the product_variation post-type), arriving as a base \WPGraphQL\Model\Post that has no get_type(). resolve_product_variation_type() then fatals. Fall back to resolving the variation's product type from its ID via wc_get_product() when get_type() isn't callable.
* chore: remove stray graphql_debug() from ProductWithPricing price resolver
* test: disable Customer Note email so order-note tests aren't polluted by the WC email-sent note
* test: cover product-variation type fallback when the node loads as a base Post model
* Add option to Change the created_via field.
Can be useful when WooCommerce is being used from multiply sources. For example, with plugins like Point of Sale for WooCommerce.
* feat: createdVia on checkout + WooCommerce order attribution origin
Builds on the createOrder createdVia option:
- Add a createdVia input to the checkout mutation. WC_Checkout::create_order()
hardcodes created_via to 'checkout' after its data loop, so process_checkout()
overrides it (and tags the attribution source type) only when createdVia is
provided; otherwise checkout keeps WooCommerce's 'checkout' default.
- createOrder now defaults created_via to WooCommerce::get_order_attribution_source_type()
('graphql-api', filterable) and writes that value to the
_wc_order_attribution_source_type order meta so GraphQL orders are attributable.
- Register a wc_order_attribution_origin_label callback that brands orders
attributed to 'graphql-api' as the 'GraphQL' origin in WooCommerce admin.
- Cover createdVia + attribution in OrderMutationsTest and CheckoutMutationTest.
---------
Co-authored-by: Scott Kennedy <scottyzen@gmail.com>
* feat: persist shipping phone through the checkout mutation
The shipping fieldset in Checkout_Mutation::get_checkout_fields() omitted
the phone field, so a phone passed in the checkout mutation's shipping
input was never mapped into shipping_phone and WC_Order::set_shipping_phone()
was never called. Add phone to the shipping fieldset so it flows through to
the order, matching the billing fieldset.
Closes#1016
* fix: load QL session handler when a session token header is present
should_load_session_handler() only matched explicit wc-ajax / WC_DOING_AJAX
and REST_REQUEST contexts. Headless callers drive session state through the
Store-API Cart-Token header or the legacy woocommerce-session header and can
land on other admin-ajax/REST entrypoints, leaving the session bootstrapped
from an absent cookie. Detect either session header and also honor
wp_doing_ajax() so QL_Session_Handler loads and rebuilds the session from the
token.
* ci: authenticate composer GitHub access to fix flaky strauss install
The dependency-install steps run with the github-oauth token that composer
rejects ("contains invalid characters"), so composer and strauss's internal
composer bootstrap fall back to unauthenticated GitHub access. Under the
shared runner IP's 60/hr unauthenticated rate limit, strauss intermittently
exits 1 during post-install-cmd, failing lint, PHPStan, wpunit, functional
and acceptance jobs at random.
Provide a well-formed COMPOSER_AUTH built from the always-available
GITHUB_TOKEN on every dependency-install step so GitHub API access is
authenticated (5000/hr), removing the flake.
* ci: run strauss with a clean composer auth context
setup-php writes the runner's GITHUB_TOKEN into composer's global auth.json,
and this composer rejects that token format ("github oauth token contains
invalid characters"). strauss spins up its own internal Composer instance,
which reads that auth, hits the validation error and exits 1 with no output,
failing every job at the post-install/post-update strauss step.
strauss only rewrites local vendor packages and needs no GitHub auth, so run
it with COMPOSER_AUTH unset and a throwaway COMPOSER_HOME. Fixes all CI
install steps, local installs and release packaging from one place.
This reverts the earlier per-workflow COMPOSER_AUTH attempt, which could not
work because composer rejects the token regardless of how it is supplied.
* style: align equals sign in should_load_session_handler (phpcs)
* fix: make name optional in updateProduct mutation
The UpdateProductInput inherited name as non_null from CreateProductInput,
requiring callers to always provide a name even when only updating other
fields. Now name is optional for updates — the existing name is preserved
when not provided.
* chore: Linter compliances met
* fix: session secret key, cart session persistence, null variation attributes
- Use wp_salt() as fallback secret key instead of hardcoded 24-byte string
to satisfy php-jwt v7's HS256 minimum key length requirement (Closes#1009)
- Call get_cart_from_session() after wc_load_cart() in
initialize_session_and_cart() to prevent cart queries from clearing
persisted session data (Closes#1010)
- Guard against null $attrs in variation_attributes_to_data_array()
to prevent PHP warnings when variations have no attributes (Closes#1011)
- Return empty array instead of null for product attribute options
when no terms exist
* chore: Linter compliances met
* chore: New feature stubbed out
* feat: Implement createRefund and deleteRefund mutations
createRefund: Creates a refund on an order with amount, reason,
optional payment gateway refund, restock, and meta data support.
Requires edit_shop_orders capability.
deleteRefund: Deletes a refund by ID with optional force flag.
Returns the deleted refund data and parent order.
Requires delete_shop_orders capability.
Both mutations include before/after action hooks for extensibility
and follow the WC REST API refund controller pattern.
Closes#17
* chore: Add PHPStan type annotation for wc_get_order in Refund_Delete
* devops: Add guard tests for deleteRefund mutation
Test invalid refund ID, order ID passed instead of refund ID,
with expectedErrorMessage assertions confirming error messages.
* devops: Variable product performance optimization and tests
- Memoize get_variation_prices() in the Product model to avoid
redundant lookups across multiple pricing fields (price, regularPrice,
salePrice, and their RAW variants)
- Remove redundant post__in filter from variations connection resolver;
post_parent already constrains the query, and the post__in triggered
an extra get_children() call per product
- Add createVariableProductCatalog() helper to GraphQLE2E for creating
variable products with many variations in tests
- Add VariableProductPerformanceTest (wpunit) measuring DB query count
and duration for 15 variable products with 18 variations each
- Add VariableProductPerformanceCest (functional) verifying 6 rapid
queries do not return 429 errors
Addresses #897
* fix: Skip timing assertion when xdebug is active and clean up debug code
* fix: Elementor breaks transfer-session endpoint with 500 error
Elementor's LandingPages module creates a WP_Query during `init` which
fires `pre_get_posts` before WooCommerce session is initialized. Our
resolve_request handler ran on this early query and called
WC()->session->get_customer_id() on null, causing a fatal error.
Fix: Guard resolve_request to only run on the main front-end query and
bail if WC session is not yet initialized. Also add Elementor to the
test environment and add functional tests that reproduce the issue.
Closes#945
* chore: Add @param docblock for resolve_request $query parameter
* devops: Remove unused resolvers and add session transaction manager tests
Remove Coupon_Connection_Resolver and Customer_Connection_Resolver
which had 0% coverage and were never instantiated.
Add SessionTransactionManagerTest covering did_transaction_expire
edge cases and next_transaction invalid/expired queue handling.
* devops: WC email template tests, COT cursor HPOS fix, checkout account auth
WC Email Template Tests:
- Add WooCommerceEmailTemplatesTest verifying WC email templates are used
for registerCustomer, checkout with account creation, and password reset
- Use MockPHPMailer to capture emails and verify HTML content type
- Disable deferred transactional emails during tests via GRAPHQL_TESTING flag
COT Cursor HPOS Fix:
- Fix COT_Cursor::compare_with to resolve orderby aliases and legacy meta
keys (_order_total, _date_completed, etc.) to COT column names
- Add resolve_orderby_alias() mapping short aliases and meta keys to columns
- Add DB_Hooks::clean_query_vars to translate post_* and meta_key orderby
to COT-compatible equivalents via woocommerce_order_query_args filter
Checkout Account Authentication:
- Add authenticate field to CreateAccountInput type
- Gate wc_set_customer_auth_cookie() behind authenticate flag in checkout
mutation so account creation doesn't auto-authenticate by default
Closes#882
* devops: codeception.dist.yml updated
* fix: Functional test cleanup and CI coverage condition
Test fixes:
- Enable authorizing URL fields in ProtectedRouterCest and
DownloadableItemAuthCest via setWooGraphQLSetting
- Add stale data cleanup (sessions, users, products, orders) to
GraphQLE2E _setupStore/getCatalog/setupStoreAndUsers
- Fix CartTransactionQueueCest and CartQueriesTest for test isolation
CI:
- Only run coverage job when at least one upstream job succeeds
* chore: Linter compliances met
* fix: HPOS order mutation data loss and CI coverage condition
Refactor order create/update mutations to set all props on a single
WC_Order instance before saving, mirroring the WC REST API pattern.
Previously, separate add_order_meta() and add_items() calls each loaded
their own order instance and saved independently, causing HPOS data loss
for payment method, addresses, and other fields.
Also fix CI coverage job to only run when all upstream jobs succeed,
and correct test assertions for RAW format line item totals.
Closes#591
* chore: Linter compliances met
* chore: Remove dead code from Order_Mutation after prepare_order refactor
Removes add_items() and update_address() which are no longer called
after the prepare_order() consolidation.
* chore: Remove dead code add_order_meta and update_item_meta_data
* feat: WC Settings API, compatibility refactor, HPOS fix, CI improvements
WC Settings GraphQL API:
- Add WCSetting interface with common fields and type-safe resolveType
- Add concrete types: WCStringSetting, WCArraySetting, WCRelativeDateSetting,
WCImageWidthSetting with typed value/default fields
- Add WCSettingGroup type with nested settings field
- Add wcSettingGroups and wcSettings root query fields (admin only)
- Add updateWCSetting and updateWCSettings mutations
- Dynamic WCSettingTypeEnum collected from registered WC settings
- Filters: graphql_woocommerce_setting_type_map, graphql_woocommerce_setting_types
- Register WC admin settings for GraphQL requests via Compatibility class
Compatibility refactor:
- Consolidate ACF, JWT Auth, and QL Search filters into Compatibility class
- Remove class-acf-schema-filters.php, class-jwt-auth-schema-filters.php, functions.php
HPOS compatibility fix:
- Replace hardcoded directory name check with dirname(__DIR__) === WP_PLUGIN_DIR
- Works with any plugin folder name while still skipping nested vendor installs
CI improvements:
- Remove STRIPE_API_PUBLISHABLE_KEY restriction from coverage job
- Add HPOS to coverage matrix entries
- Sort type registry and includes alphabetically
Other fixes:
- Fix Settings_Mutation::validate_setting_checkbox_field to be static
- Update ShippingZone settings field type to WCStringSetting
Closes#864, closes#969
* refactor: Rename and split core classes, add order cursor pagination tests
Class renames:
- WooCommerce_Filters → WooCommerce (class-woocommerce.php), setup() → init()
- Core_Schema_Filters → Post_Types (class-post-types.php)
Class split:
- Extract taxonomy registration from Core_Schema_Filters into Taxonomies (class-taxonomies.php)
Access functions:
- Add wc_graphql_resolve_product_type() for interface resolveType callbacks
- Add wc_graphql_is_session_handler_disabled()
- Add wc_graphql_enabled_authorizing_url_fields()
- Add wc_graphql_get_authorizing_url_nonce_param_name()
- Replace direct class references with global functions in type-registry,
compatibility, protected-router, and all product interface files
Stripe gateway compatibility:
- Move woographql_stripe_gateway_args from WooCommerce to Compatibility class
- Rename to woocommerce_gateway_stripe_args
Tests:
- Add OrderCursorPaginationTest (6 tests) covering COT cursor-based
pagination: forward/backward, date ordering ASC/DESC, cursor integrity
* fix: Use proper expectedField/expectedNode assertions in cursor pagination tests
Replace empty assertQuerySuccessful([]) calls and manual lodashGet
assertions with expectedField, expectedNode, and not()->expectedNode()
for proper GraphQL response validation.
* fix: downloadsRemaining returns null for valid numeric string values
Use is_numeric() + intval() instead of 'integer' === gettype() to handle
cases where WooCommerce stores downloads_remaining as a numeric string.
Mirrors WooCommerce's own approach in its download templates.
Co-authored-by: Nestor Vera <hacknug@users.noreply.github.com>
Closes#937
* fix: Match CI phpcov php-code-coverage version to Docker container
The Docker container uses php-code-coverage 9.2.x which serializes
coverage with v9 classes (e.g. Xdebug3Driver). phpcov v9 bundles
php-code-coverage v11 with different classes, causing
__PHP_Incomplete_Class errors. Pin to phpcov v8 + php-code-coverage v9
to match the Docker environment.
---------
Co-authored-by: Nestor Vera <hacknug@users.noreply.github.com>
* fix: Order status filter incorrectly uses single value when statuses is the only filter arg
The condition `1 === count($where_args)` checked the total number of filter
args instead of `1 === count($where_args['statuses'])`, causing multi-status
queries to only return results for the first status when no other filters
were provided.
Closes#968
* fix: Upgrade phpcov to v9 for newer coverage file format
The Docker test environment produces .cov files in the php-code-coverage
v10+ format (PHP file wrapper around serialized data). phpcov v8 only
supports raw serialized data and silently produces empty coverage.
* always calculate; default quantity of 1
* fill the name; complete order item data
* dont introduce new requirement; leave as is
* fix: auto-fill line item data from product, add format arg to LineItem pricing fields, fix isPaid check (#946)
* devops: upload coverage XML and JSON as debug artifacts after Coveralls push
* chore: Lintercompliances met
---------
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
* fix: Sanitize ProductAttribute name to match VariationAttribute [#965]
* devops: add unit test for attribute name consistency between product and variation (#965)
* devops: fix phpcov merge by using .cov extension and pinning phpcov to v8
* chore: Lintercompliances met
* fix: update test expectation for sanitized local attribute name
---------
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
* Adds support for tax_lines
* devops: cleanup cart tax lines code style and add unit tests
* feat: add tax-aware cost, subtotal, and taxTotal fields to ShippingRate (#802)
* feat: add format arg to ShippingRate cost/subtotal/taxTotal fields, update test for RAW format
* devops: CartQueriesTest updated
---------
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
* feat: add plugin wp-2fa
* devops: add unit test for variation attribute label human-readable values (#965)
* fix: use wc_attribute_label() for variation attribute label instead of term name
---------
Co-authored-by: creative-andrew <andres@netzstrategen.com>
* feat: add authenticated download URLs for headless frontends
- Add downloadNonce and downloadUrl fields to DownloadableItem type
using the existing Protected Router session transfer pattern
- Add preAuthDownloadUrl field (toggleable via settings) that generates
tokenized download URLs for direct file access without cookie auth
- Add download_url nonce handling to Protected_Router
- Add enable_pre_auth_download_urls and download_url_nonce_param settings
- Add GraphQLE2E helpers for checkout and account shortcode pages
- Rewrite ProtectedRouterCest to test redirect flow without JS-dependent
page content assertions, add account and payment method URL tests
- Add DownloadableItemAuthCest with 5 e2e tests covering both options
* fix: test suite stability and code coverage collection
- Add WC_Unit_Tests_Bootstrap stub to wpunit bootstrap to bypass
wc_get_product_visibility_term_ids static cache between suites
- Add setWooGraphQLSetting helper to GraphQLE2E for safe individual
field updates to woographql_settings option with proper defaults
- Update all functional tests to use setWooGraphQLSetting instead of
replacing the entire woographql_settings option
- Fix createRelated factory to use explicit shared category instead
of relying on default Uncategorized category
- Add download_url to ProtectedRouterTest nonce names assertion
- Remove debug logs from ProductQueriesTest and ProductsQueriesTest
- Fix CI workflow to run suites separately and aggregate coverage
via phpcov merge
- Wire c3.php into WordPress index.php for remote coverage collection
- Update .coveralls.yml service_name to github-actions
- Clean up Xdebug 2 settings in Dockerfile
* chore: Linter compliances met
* fix: ensure tests/_output is writable for c3.php coverage collection
* devops: .env.docker removed from setup
* devops: split CI into separate jobs per suite with retry and coverage aggregation
* devops: add +Coverage indicator to CI job names
* devops: add --fail-fast to first run, fix retry to mark job as passing on retry success
* fix: improve i18n compatibility for WPML, Polylang, and non-latin character support
- Add Label::get_safe_enum_name() utility with optional transliteration
for non-latin tax class/attribute/taxonomy names (#637, #409)
- Add "Transliterate non-latin characters" admin setting
- Replace get_page_by_path() with WP_Query for product slug resolution
so WPML/Polylang can hook into the standard query pipeline (#403, #368)
- Split product connections: `products` (toType: Product) and
`productsWithVariations` (toType: ProductUnion) so i18n plugins can
register language where args on the standard type name (#811, #952)
- Add ProductTypesWithVariationsEnum for the ProductUnion connection
- Add i18n compatibility tests
* chore: Linter compliances met
Adds a new "Session Transfer Behavior" setting to the WooGraphQL
settings page that controls how cart/session data is handled when
a user logs in with an existing session from another device:
- keep_new_fallback_old (default): keeps current guest session data,
falls back to previously saved user session if guest data is empty
- keep_new: always keeps the current guest session data
- keep_old: restores the previously saved user session data
Move session initialization from graphql_process_http_request hook to
init_graphql_request hook with an is_graphql_http_request() guard.
graphql_process_http_request fires before WPGraphQL's OPTIONS check in
Router::process_http_request(), causing wc_load_cart() to create a new
session for every preflight request. init_graphql_request fires inside
Request constructor which is only instantiated after the OPTIONS exit.
The is_graphql_http_request() guard ensures initialize_session_and_cart()
only runs for actual HTTP requests, not programmatic graphql() calls in
tests or internal usage.
* devops: add createOrder stock reduction test
Adds test confirming that createOrder with isPaid: true correctly
reduces stock quantity. Tests COD (→ COMPLETED) and BACS (→ PROCESSING)
payment methods, and documents that setting status explicitly alongside
isPaid bypasses WooCommerce's stock reduction hooks. Users should rely
on isPaid alone and let WooCommerce determine the correct order status.
* devops: migrate OrderMutationsTest to factories and add stock reduction test
- Replace deprecated test helper classes with factory equivalents
- Replace wp_set_current_user with loginAsShopManager/loginAsCustomer
- Remove codecept_debug calls (graphql() already logs responses)
- Rename $actual to $response throughout
- Move order creation from setUp to individual tests using createNew()
- Enable woocommerce_manage_stock and payment gateways in setUp
- Add stock reduction test confirming createOrder with isPaid: true
reduces stock, and documents that setting status explicitly alongside
isPaid bypasses WooCommerce's stock reduction hooks
WooCommerce's remove_coupon() does not call calculate_totals() — it only
sets a refresh_totals flag for the next request. This means cart totals
returned in the removeCoupons mutation response may be stale. Add an
explicit calculate_totals() call after the coupon removal loop.
Adds regression test mirroring the exact query pattern from #891 that
stopped returning products. Tests categoryId filtering, status and
visibility where args, and cursor-based pagination together. The issue
is not reproducible on the current codebase.
Adds test confirming that querying a parent category's products
includes products from child and grandchild categories. The issue
was reported on v0.12.0 and is not reproducible on the current
codebase.
Adds test confirming that categoryId filtering works on the products
connection from attribute term types (e.g. allPaSeller.products).
The issue was reported on v0.12.1 and is not reproducible on the
current codebase.
Adds tests for taxonomyFilter with multiple terms in a single filter
and multiple terms across multiple taxonomies. Covers the scenario
from #821 where passing multiple terms only returned products for
the first term. The issue was fixed in PR #948.
- Fix coupon productCategories and excludedProductCategories connections
to convert term_ids to term_taxonomy_ids before querying, resolving
failures when term_id and term_taxonomy_id differ (shared terms across
taxonomies)
- Remove dead WC post type taxonomy connection loop that was skipping
products/variations and had no effect on remaining post types
- Remove unused WPGraphQL and WP_GraphQL_WooCommerce imports
- Add coupon category connection test with mismatched term IDs and
exclude filter validation
- Add product category test with mismatched term_id/term_taxonomy_id
regression coverage
* fix: coupon error handling in fillCart and applyCoupon mutations
- Fix validate_coupon() post ID check to only trigger for numeric codes,
allowing invalid string codes to fall through to WooCommerce's is_valid()
which returns consistent error messages regardless of casing
- Add fillCart coupon error tests: minimum spend validation and invalid
coupon code errors are correctly reported in cartErrors
- Add applyCoupon casing test: error messages are consistent across
lowercase, uppercase, and mixed case invalid coupon codes
* chore: Linter compliances met
Adds test confirming that updateOrder with only metaData input does
not create duplicate orders, covering both new meta creation and
existing meta updates. The issue was likely caused by incorrect ID
resolution via Relay::fromGlobalId() which was fixed in commit
7c10a3d4 (ID resolution made consistent across all mutations).
Adds VariableProductQueriesTest with 3 tests confirming that the
defaultAttributes connection on VariableProduct correctly resolves the
"Default Form Values" set in the WooCommerce admin:
- Verifies defaultAttributes returns correct name/value pairs
- Verifies empty defaults return empty nodes
- Verifies defaultAttributes can be matched to a specific variation
The array_intersect_key call in the orders connection resolver was
filtering all $args (including first, last, after, before) against
get_connection_args('public') keys. Since get_connection_args returns
where arg definitions (not top-level connection args), the intersection
matched nothing and stripped everything.
Fix: only filter $args['where'] instead of all $args, so pagination
and other connection args are preserved for non-admin customers.
* refactor: Product_Attribute_Connection_Resolver class refactor to be more consistent with contemporaries
* refactor: Product_Attribute_Connection_Resolver class refactoring continued
* feat: implement productAttributes root query, products connection on ProductAttribute, and category-scoped attributes
- Implement build_nodes_from_global_attributes() to return WC_Product_Attribute
objects from wc_get_attribute_taxonomies()
- Fix build_connection() infinite recursion and undefined variable bugs
- Add products connection from ProductAttribute interface to Product via
tax_query (global) or meta_query (local) in class-products.php
- Add productAttributes connection from ProductCategory to GlobalProductAttribute
in class-product-attributes.php
- Move localAttributes/globalAttributes connections from class-product-attributes.php
to ProductWithAttributes interface get_connections()
- Fix ProductAttribute id resolvers to use Relay::toGlobalId() instead of
dynamically set _relay_id
- Remove deprecated get_items() method and GLOBAL_ID_DELIMITER constant
- Add ProductAttributeConnectionsTest with 4 tests covering root query,
global/local attribute products connections, and category-scoped attributes
- Update ProductAttributeQueriesTest expectations for new id format and
taxonomy-prefixed attribute names
* feat: Add support for brands (#918)
* feat: add product brand support with where args, taxonomy filter, and taxonomy mutation input fields
- Register product_brand taxonomy with WPGraphQL (fix indentation from #964)
- Add productBrand/productBrandIn/productBrandNotIn/productBrandId/productBrandIdIn/productBrandIdNotIn
where args on products connection
- Add product_brand to taxonomy args map and case statements in product connection resolver
- Register additional input fields (display, menuOrder, imageId) on
CreateProductCategoryInput and UpdateProductCategoryInput mutations
- Split ProductTaxonomyQueriesTest into ProductCategoryQueriesTest,
ProductTagQueriesTest, ProductCategoryMutationsTest, ProductTagMutationsTest
- Add ProductBrandQueriesTest with 8 tests covering queries, connections,
hierarchy, where args, taxonomy filter, and CRUD mutations
---------
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
* test: add hCaptcha session token regression test
Adds functional test verifying the session token is correctly linked
to the authenticated user after login when hCaptcha for WP is active.
Resolves#941Resolves#942
* devops: login test added
* fix: refresh order object after meta save in checkout mutation
The woocommerce_checkout_order_processed hook was receiving a stale
order object without the metadata saved by update_order_meta().
Refreshing the order via wc_get_order() after meta save ensures
plugins hooking into woocommerce_checkout_order_processed can access
the checkout metadata.
Resolves#932
* chore: Linter compliances met
* test: add checkout shipping method selection regression test
Verifies that the checkout mutation respects the shipping method from
the input and doesn't silently fall back to the WooCommerce default
(cheapest) rate.
Resolves#927
* fix: remove duplicate mutation registrations in type registry
Removed duplicate register_mutation() calls for checkout, coupon
(create/update/delete), and review (write/update/delete_restore)
mutations that were introduced during rebase.
* devops: Product and product attribute mutation tests generated
* feat: Product Mutations implemented and tested
* chore: Linter and PHPStan compliance met
* fix: resolve test failures in product and variation mutation tests
- Removed duplicate requires for payment-method classes (rebase artifact)
- Wrapped bare `attributes` queries in `... on SimpleProduct` inline
fragments (attributes field is on ProductWithAttributes interface,
not the base Product type)
- Fixed attribute label expectations to match factory output (lowercase)
- Fixed relay ID prefix from 'product'/'product_variation' to 'post'
to match WPGraphQL's actual encoding
- Cache WP_Post before force-deletion and re-cache after so the Product
model's type resolver can still determine the GraphQL type in the
response
- Added wp_cache_flush() before asserting product deletion to avoid
false positives from the re-cached post
* chore: fix PHPCS lint errors in mutation files
* fix: resolve CI test failures for attribute and variation mutations
- Fixed ProductVariation type registration in schema filters so the
variation mutation output field resolves correctly
- Renamed attribute slug from 'pattern' to 'fabric' in
ProductAttributeMutationsTest to avoid collision with the pattern
attribute created by ProductAttributeQueriesTest
- Fixed PHPStan errors for redundant is_wp_error checks
- Updated IntrospectionQueryTest
Adds test verifying productCategories children connection returns
subcategories correctly. Fixes existing tests that passed arrays
instead of integer IDs to createProductCategory's parent parameter,
and updates assertions to account for proper parent-child hierarchy.
Resolves#828
* fix: Checkout notices further implemented
* fix: resolve PHPCS lint errors and remove commented-out code
* test: add stale notice leak regression test
Verifies that error notices from a failed checkout do not leak into
subsequent checkout attempts, reproducing the exact scenario from #666.
* fix: add authenticate flag to registerCustomer mutation
Adds an optional `authenticate` boolean input to the registerCustomer
mutation. When true, the mutation sets the current user and reinitializes
the session token for the newly registered customer. Defaults to false
to prevent nonce verification failures in contexts like GraphiQL that
send a nonce with the request.
Resolves#464
* test: add authenticate flag to existing register customer tests
The existing wpunit tests for registerCustomer rely on the user being
authenticated after registration to assert on customer.databaseId and
viewer.userId. Now that authenticate defaults to false, the tests must
explicitly pass authenticate: true.
* test: add authenticate flag to testCustomerMutationsWithMeta
* fix: use explicit billing emails in CustomerQueriesTest assertions
Use wildcard index matching with specific email values instead of
hardcoded node indices with NOT_NULL checks. This prevents failures
when other users in the DB shift the node positions.
* fix: resolve REQUEST_URI fatal error and JWT key length issues in CI
QLSessionHandlerTest::tearDown() was calling unset($_SERVER) which
destroyed the entire superglobal. WordPress cron.php then fataled on
shutdown when accessing $_SERVER['REQUEST_URI']. Changed to only unset
the specific HTTP_WOOCOMMERCE_SESSION key.
Also updated JWT secret keys to meet firebase/php-jwt v7's minimum
32-byte requirement for HS256 in both test config and Docker entrypoint.
* fix: the rest of the files added
* devops: php7.4 removed from matrix
* chore: Linter compliances met
* devops: More broken test updated
* devops: Tests updated for CI
* fix: QLSessionHandlerCest fixed
* fix: QLSessionHandlerCest fixed
* devops: CI fixed
* feat: Add Store API Cart-Token compatibility and session handler improvements
* chore: Linter compliances met
* chore: linter compliances met
* chore: linter compliances met
* fix: recursive interface definitions for Product, etc.
* devops: CI & Linter compliances met
* devops: lint-code.yml updated
---------
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>