Product post_type should be set to show_in_graphql
#85
Labels
bug
Something isn't working
design notes
Blueprint and notes for coming feature
enhancement
New feature or request
failing integration
Issue concerns a failing/broken integration with another WPGraphQL extension
Milestone
Describe the bug
Currently, the
Product
Type is registered to the Schema without respect to post_type registry.Since
Products
in WooCommerce are Post Types, we should use the Post Type registry to set the post_type toshow_in_graphql
instead of registering the Product type without connection to the Post Type it represents.By extending the Post Type registry, other plugins can know what Post Types are exposed to GraphQL.
For example, the WPGraphQL for ACF plugin checks for all post types that are set to
show_in_graphql
using the following:get_post_types( 'show_in_graphql' => true )
and the product post type isn't included because the Post Type registry has no knowledge that theProduct
post_type is exposed to GraphQL.We should make use of the internal WordPress registries as much as possible and extend them so that other tools in the ecosystem can benefit as much as possible.
The text was updated successfully, but these errors were encountered: