52 Commits
Author SHA1 Message Date
Geoff TaylorandGitHub 088d337ef5 fix: address WordPress.org plugin review (rename + prefixing + headers) (#1019)
* 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.
2026-06-30 10:16:21 -04:00
Geoff TaylorandGitHub 684732aa0d perf: Migrate type descriptions to lazy lambdas (#1005)
* perf: Migrate type descriptions to lazy lambdas

Convert all eager description strings from:
  'description' => __( '...', 'wp-graphql-woocommerce' ),
to deferred lambdas:
  'description' => static function () { return __( '...', 'wp-graphql-woocommerce' ); },

This defers the __() translation call until the description is actually
needed (e.g. during schema introspection), avoiding unnecessary
translation overhead on every GraphQL request. Mirrors the pattern
used in WPGraphQL core.

1206 descriptions converted across 169 files.

* chore: Linter compliances met
2026-03-30 23:37:51 -04:00
Geoff TaylorandGitHub f63dbb75e8 Improve i18n compatibility for WPML, Polylang, and non-latin characters (#994)
* 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
2026-03-24 20:42:15 -04:00
Geoff TaylorandGitHub 8f4d3c3709 feat: productAttributes query implemented (#905)
* 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
2026-03-23 14:55:56 -04:00
e3ca7f895e feat: Add support for brands (#918) (#964)
* 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>
2026-03-23 12:28:48 -04:00
Geoff TaylorandGitHub 22b03e42b4 fix: "Product" interfaces shared fields fix (#901)
* fix: "Product" interface applied to all sub Product interfaces for more optimal schema shape

* fix: more inconsistencies fixed.

* feat: "ProductWithAttributes" interface radded to "ProductWithVariations" interface
2024-11-06 11:35:14 -05:00
Geoff TaylorandGitHub 6028061a50 fix: TaxonomyToProduct connections fixed and tested (#857) 2024-05-16 23:09:46 -04:00
Geoff TaylorandGitHub f1d96bead4 collectionStats query fully implemented (#849)
* fix: WPGraphQL v1.24.x support added

* fix: WPGraphQL v1.24.x support added

* chore: Linter and PHPStan compliance met

* chore: composer.json fixed

* fix: Unnecessary type check restored

* chore: Linter and PHPStan compliance met

* devops: CollectionStatsQueryTest patched
2024-05-16 21:27:54 -04:00
Geoffrey K TaylorandGitHub 6b0c798f91 feat: collectionStats query added (#785)
* feat: collectionStats query added

* fix: `collectionStats` query completed and tested.

* chore: Linter and PHPStan compliance met

* chore: ProductTaxonomy values fixed.

* chore: CollectionStatsQueryTest tweaked for CI
2023-09-23 03:50:17 -04:00
Geoffrey K TaylorandGitHub 134dc5eaf7 feat: "found" field added to the Products Connection types (#804) 2023-09-15 23:31:24 -04:00
Geoffrey K TaylorandGitHub c526a5b527 feat: ProductWithAttributes and ProductVariation interfaces added (#803)
* feat: ProductWithAttributes and ProductVariation interfaces added

* chore: Unused files removed
2023-09-15 21:03:55 -04:00
Geoffrey K TaylorandGitHub 481c12c7f9 feat: Several product interfaces added. (#801) 2023-09-15 00:21:00 -04:00
Geoffrey K TaylorandGitHub 81502f9d43 fix: ProductUnion interface added (#797)
* fix: ProductUnion interface added

* chore: Linter and PHPStan compliance met
2023-09-11 17:42:26 -04:00
Geoffrey K TaylorandGitHub 87d7a7b1a9 fix: ProductVariation type made to inherit the Product interface. (#788)
* devops: WP theme during e2e locked to TwentyTwentyOne

* fix: "Product Connection Resolver" restored

* chore: Linter/PHPStan compliance met

* devops: CustomerProceedsToCheckoutCept updated.

* chore: Linter compliance met
2023-08-22 17:14:39 -04:00
f583628199 chore: implement WPGraphQL Coding Standards (#769)
* chore: avoid magic constants [PHPCS]

* chore: change ruleset to wp-graphql-cs and lint

* devops: HPOS added back to CI with the release of WC 3.9

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2023-07-19 17:11:25 -04:00
Dovid LevineandGitHub 58fbce7c57 fix: clean up unnecessary variables and ternaries (#766) 2023-07-19 16:10:23 -04:00
Dovid LevineandGitHub 4ed9cb94da chore: use fully-qualified class names for PHPDoc types (#767)
* fix!: update deps to required versions

* chore: use fqcn for PHPDoc types

* chore: cleanup use statements
2023-07-19 16:01:50 -04:00
Dovid LevineandGitHub d4927b9637 fix: use static closures when possible (#764)
* fix!: update deps to required versions

* fix: use static closures when possible
2023-07-19 15:56:42 -04:00
4ef46acd15 chore: setup PHPStan (#746)
* chore: setup PHPStan

* chore: General code cleanup for PHPStan

* chore: PHPStan to level 2

* chore: PHPStan to level 2

* fix: Syntax error fixed.

* devops: PHPStan level 2 reached.

* devops: PHPStan level 3 passed

* devops: PHPStan level 4 passed

* chore: fix bad typehints from jwt-auth [phpstan]

* chore: simplify conditional logic in WC_Terms::register_connections()

* chore: add stubs for WP type properties.

* fix: check for valid WC_Order_Item before caching order.

* chore: lint

* devops: PHPStan level 6 passed.

* chore: Linter compliance met.

* chore: simplify logic and check for valid term.

* fix: ensure valid types (partial)

* chore: [phpcs] allow inline type annotations

* devops: PHPStan level 8 reached.

* devops: More stability fixes.

* fix: general bugfixes and improvements

* devops: Code Quality GA script added.

* devops: Linter compliance met & 2 "phpstan-ignore" statements set.

* devops: PHPStan config and CI script fixed.

* fix: "cartItem" query resolution refactored

* devops: GA scripts updated.

* chore: Simple copy changes

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2023-06-13 16:17:02 -04:00
Geoffrey K TaylorandGitHub de8cad3a81 fix: Fixed all product connection filtering regressions (#704)
* fix: Fixed all product connection filtering regressions

* chore: WPCS compliance met

* fix: Unsupport syntax refactored
2023-02-02 16:47:19 -05:00
Geoffrey K TaylorandGitHub 121918ffe2 devops: Test Scripts updated. (#702)
* devops: Test Scripts updated.

* chore: WPCS compliance met.
2023-02-01 14:57:46 -05:00
Berry HijwegenandGitHub 7f6a7a1c13 Add filter to add custom fields to product sort (#690) 2023-01-23 15:50:50 -05:00
GillesandGitHub e772b2387e fix:$post_type must be an array when passed to in_array() (#695)
* * `$post_type` must be an array when passed to `in_array()`.
* Removes unused `$post_type_obj` variable.

* * Fixes tabs.
2023-01-23 15:48:09 -05:00
0b8ce4f634 fix: Connections need to connect to Types that implement the Node interface (#675)
* - implement Node on different Types

* - update class-customers to return arrays for edges and nodes
- move id resolver from product-attribute interface to the specific types

* - return empty arrays for edges/nodes for coupon connections
- update test to check for falsy vs null

* - remove manual registration of the `Product` Interface
- register the fields to the Product Interface

* - fix code style

* - fix code style

* - no longer pass type registry to Product::register_interface()

* -  use post type registry to register the Product type as an Interface

* WPGraphQL v1.13.x support added.

* WPGraphQL v1.13.x support added.

* fix: filter corrected.

* fix: Needed code restored

* fix: Needed code restored

* parent field no longer overwritten

* chore: WPCS compliance met.

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2022-12-07 17:04:39 -05:00
Geoffrey K TaylorandGitHub 9073793e86 chore: WPGraphQL v1.9.x connection resolver support added and autoloader removed. (#647)
* chore: WPGraphQL v1.9x + WP Bedrock support added.

* chore: lint compliance met.

* chore: composer/installers added back to allow-plugins
2022-08-26 14:53:36 -04:00
Geoffrey K TaylorandGitHub 6dbdcb5ae8 fix: Product Attribute naming conventions changed (#603)
* fix: Product Attribute naming conventions changed

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: Dockerfile updated

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: Dockerfile updated

* chore: Docker composer configurations updated

* chore: Coding standards met.
2022-02-04 15:00:44 -05:00
Geoffrey K TaylorandGitHub 1d52337bcd Product and order connections queryClass set. (#550)
* fix: Product and order connections use respective queryclasses.

* fix: include + exclude product connection where args fixed and tested

* chore: docker-compose.yml restored
2021-10-22 19:30:16 -04:00
Geoffrey K TaylorandGitHub 2ea8591be3 Fix: product connection sorting (#522) 2021-07-05 18:49:25 -04:00
Geoff Taylor 66690f03ff "Customer_Connection_Resolver" deprecated. 2021-06-14 11:40:42 -04:00
Geoff Taylor 22bbc38765 WPCS compliance met. 2021-06-12 22:18:41 -04:00
Geoff Taylor 9e31f47e51 Cart item connection pagination refactored. 2021-06-12 22:06:44 -04:00
Geoff Taylor e293fe8b6a coding standards met. 2021-06-04 19:58:37 -04:00
Geoff Taylor 86c7fb8b4e Refund connections refactored. 2021-06-04 00:12:35 -04:00
Geoff Taylor 41be17c16f Product connections now resolved thru "PostObjectConnectionResolver" class. "Product_Connection_Resolver" class deprecated. 2021-05-15 17:56:16 -04:00
Geoff Taylor aacb6bf2bf Workflow badges updated. 2021-01-22 11:37:18 -05:00
Geoff Taylor ddf7661ccf Minor patches applied 2020-10-15 13:12:57 -04:00
Geoff Taylor b7a14f95a1 Session Handler upgraded. 2020-10-01 01:45:26 -04:00
Geoff Taylor f221571458 Grouped product and product variation connection tests refactored. 2020-09-03 16:53:42 -04:00
Geoff Taylor 664bacf429 Heavy refactor of productconnection "resolve" functions. 2020-08-07 10:35:21 -04:00
Geoff Taylor f5f3de1de8 Deprecated "By" queries removed. More connection resolver cleanup. 2020-03-27 12:18:06 -04:00
Geoff Taylor f14a9478d0 wc-db-loader created 2020-03-20 23:12:04 -04:00
Renato Alves 1e0546c1ea Updating connection classes 2020-02-27 21:30:21 -03:00
Geoff Taylor 180276e07b Improved unsupported type handling 2020-01-03 13:05:58 -05:00
Geoff Taylor 6e93aa245f Woocommerce cart resolvers updated. 2019-12-03 16:26:10 -05:00
Geoff Taylor 56138c9a30 Unneeded "register_graphql_connection()" calls removed. 2019-11-04 10:28:54 -05:00
Geoff Taylor 22deb98fe9 Namespaces refactored. 2019-10-25 19:13:36 -04:00
Geoff Taylor 52ceafce03 "ProductUnion" to "Product" 2019-10-24 22:11:04 -04:00
Geoff Taylor 971f4eaf0f ""ProductUnion" type implemented. 2019-10-17 21:39:38 -04:00
Geoff Taylor df4947e596 Several new WPEnumType and WPInputObject types implemented. 2019-09-29 15:11:02 -04:00
Geoff Taylor 05019140f8 Product connection field "taxonomyFilter" where arg implemented and tested. 2019-08-22 15:31:34 -04:00