Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add WooCommerce support and functionality to your WPGraphQL server

License

NotificationsYou must be signed in to change notification settings

wp-graphql/wp-graphql-woocommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

WPGraphQL for WooCommerce (WooGraphQL) Logo

WPGraphQL for WooCommerce

WebsiteDocsSchemaPlaygroundAbout • Join Slack

Automated-TestingCoding StandardsCoverage StatusFinancial Contributors on Open Collective

Install

Installing Manually

  1. Install and activateWPGraphQL andWooCommerce.
  2. Download thewp-graphql-woocommerce.zip file from the Assets section of the most stablerelease and activate the plugin in your WordPress directory.
  3. Set your GraphQL client endpoint to your site's GraphQL endpoint. Typically, this isyour-store.domain/graphql.

Installing with Composer

This method is recommended for users with unique installations like WP Bedrock or SpinupWP.

  1. InstallWordPress andWooCommerce.
  2. Install WPGraphQL and WPGraphQL for WooCommerce by runningcomposer require wp-graphql/wp-graphql wp-graphql/wp-graphql-woocommerce.
  3. Set your GraphQL client endpoint to your site's GraphQL endpoint. For typical Bedrock or SpinupWP setups, the default will beyour-store.domain/wp/graphql.

Optional Extras

  • Install & activateWPGraphQL-JWT-Authentication to introduce alogin mutation that returns a JSON Web Token.
  • Install & activateWPGraphQL Headless Login to introduce alogin mutation with OAuth2 client support.Shouldn't be used with WPGraphQL-JWT-Authentication
  • Install & activateWPGraphQL-CORS for enhanced security via HTTP CORS and to utilize some advanced WPGraphQL features.

What Can You Do with This Extension?

  • Query your shop's products and variations with detailed filtering options.
  • Query customers, orders, coupons, and refunds. Note: Operations have user restrictions.
  • Manage customer sessions using JWTs, and use cart/customer queries and mutations. Note: Operations have user restrictions.
  • Manually create orders, automate order creation with the checkout mutation, or delegate a customer's session to the WooCommerce checkout page in your theme for comprehensive payment gateway support.

(*) These operations have user restrictions. Learn how to utilize them correctly at the resources listed below:

(#) The recommended method to checkout, taking full advantage of WooCommerce's payment gateways for payment process and other checkout-related extenstions, is to pass the session back to the WordPress installation and let WooCommerce take over from the tradition checkout page. Learn more about this approach below.

Alternatively, you can create a custom checkout form and process payments externally. Here is some resources for that as well.

Why Don't WooCommerce CPT GraphQL Types Support All the Features WPGraphQL Exposes for Most WordPress CPTs?

WooCommerce's Custom Post Types (CPTs) and most data objects are managed by a data store system. This system allows for flexible data object definitions. While objects likeproducts,orders, andcoupons are defined as WordPress CPTs by default, they don't have to be.

This flexibility also lets WooCommerce store metadata for these CPTs in separate tables, and the data doesn't necessarily have to reside in the same database.

The data store system and its object managers are WooGraphQL's primary contact points. Unlike standard CPTs, which use aWP_Post object for data sourcing and aWPGraphQL\Model\Post object for modeling, WPGraphQL for WooCommerce engages object managers for its data source. Each object type has a unique model with distinct permissions and restrictions.

Such a setup has resulted in some disparities between the schema where WPGraphQL for WooCommerce support might be lacking. We apologize for any inconvenience. Both I and the entireWPGraphQL team are actively working to harmonize WPGraphQL for WooCommerce with allWPGraphQL andWPGraphQL ACF features.

Thank you for your patience 😄@kidunot89

Future Features

  • Product CRUD mutations.
  • And some other stuff I'm sure 🤔

For WooCommerce Extensions Support

WooGraphQL Pro is an extension of WPGraphQL for WooCommerce that provides compatibility with a variety of popular WooCommerce extensions. This compatibility empowers you to leverage these extensions within the context of the GraphQL API, thereby enabling you to build more dynamic and powerful headless eCommerce applications.

The following WooCommerce extensions are supported by WooGraphQL Pro:

  • WooCommerce Subscriptions
  • WooCommerce Product Bundles
  • WooCommerce Product Add-Ons
  • WooCommerce Composite Products

Installing Supported WooCommerce Extensions (Optional)

If you wish to use any of the supported WooCommerce extensions with WooGraphQL Pro, follow these steps:

  1. Purchase your desired extensions from the WooCommerce marketplace. The supported extensions are listed above.
  2. Download the.zip file(s) for your purchased extension(s) from your WooCommerce account.
  3. In your WordPress Admin Dashboard, navigate to Plugins > Add New > Upload Plugin, and upload the downloaded.zip file(s).
  4. Once the upload is complete, click on 'Activate Plugin' to activate the extension(s).

Installing and Activating WooGraphQL Pro

To install and activateWooGraphQL Pro, follow these steps:

  1. Purchase WooGraphQL Pro from our officialwebsite.
  2. After purchase you should find yourself on your account dashboard. Go to theLicenses page and generate and new license and copy it for later.
  3. Next go to theDownloads page and download the latest version of WooGraphQL Pro.
  4. Go to your WordPress Admin Dashboard, navigate to Plugins > Add New > Upload Plugin, and upload thewoographql-pro.zip file you downloaded.
  5. After uploading, click 'Activate Plugin' to activate WooGraphQL Pro.

Enabling Schema Support for Installed Extensions

To enable schema support for your installed extensions, follow these steps:

  1. Navigate to the WPGraphQL settings page on your WordPress Admin Dashboard.
  2. Click on the 'WooGraphQL' tab.
  3. Here, you'll find a list of WPGraphQL for WooCommerce configuration options. Go below to theWooGraphQL Pro section and paste in license and check the boxes next to your installed extensions to enable schema support for them.

Note: The 'Enable Unsupported Product Type' option can be found on the same settings tab. If you enable this option, any product type without a proper GraphQL type will default to theUnsupportedProduct type, which is identical to theSimpleProduct type. With this type, the client can use themetaData field to get astring representation of the meta data on the type. This could potentially be all that's needed for simpler product types.

With WooGraphQL Pro and your chosen extensions now installed, you're ready to build more sophisticated, feature-rich eCommerce solutions with WordPress and WooCommerce.

Development Tools

Playground

Feel free to test out the extension using thisGraphiQL Playground. The playground allows you to execute queries and mutations, as well as view the schema (*).

(*) I have a tendency to forget to update the playground between releases 😅, so if you believe this to be the case look me up somewhere on this page and lemme know 🤷‍♂️

create-woonext-app CLI and@woographql packages

Designed to both streamline development for individuals and teams looking to utilize WooCommerce + WooCommerce extensions in larger project and not waste too much to much time on the particulars of WPGraphQL for WooCommerce like session management or checkout, thecreate-woonext-app CLI generates a pre-created e-commerce application onNext.js application tailored to the developer/team.

npx create-woonext-app<license> [options]

The generated application utilizes the@woographql packages exclusive to the unlimited/annual subscribers of WooGraphQL Pro. So GoSubscribe! 😄. Below are more resources on thecreate-woonext-app CLI and@woographql packages.

  • create-woonext-app Homepage
  • create-woonext-app on NPM: Thecreate-woonext-app README with more CLI usage instructions.
  • create-woonext-app Live Demo: fully decked out putting all current possible functionalities of thecreate-woonext-app on full display.
  • @woographql/next README: A Template generator CLI. Capable of generator a multitude of Next.js pages, Next.js Route Handlers, react components, react hooks, and utilities. It's also equipped to generate react component and hook stubs for speedy component create with no boilerplate.
  • @woographql/react-hooks README: React hook library acting as the backbone for UI connected to session, cart, and customer.
  • @woographql/session-utils README: Provides utilities for managing the WPGraphQL + WPGraphQL for WooCommerce session tokens like aTokenManager, also provides interfaces and types for easy customization of saidTokenManager or the complete creation of a customTokenManager with minimal effort. The bundled TokenManager implemented utilizes browser storage(Local/Session storage), so if you'd prefer something likeIron Session this might be the route for you.
  • @woographql/codegen README: A convenient wrapper for GraphQL Codegen providing a few configurations out of the box, with the ability to override the default configuration by creating acodegen.ts in the project root.

Wanna help support WooGraphQL's future

Followalt textalt text

Demo/Examples

Who using it?

Rocky Mountain Sewing & VacuumRussemerketwohnparc.de
Rocky Mountain Sewing & VacuumRussemerketwohnparc.de

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Disclaimer:WPGraphQL for WooCommerce is an open-source WordPress plugin and WooCommerce extension developed and maintained byGeoff Taylor, licensed under GPLv3. It is not owned, maintained, or affiliated withAutomattic orWooCommerce.

Sponsor this project

 

Packages

No packages published

Contributors45

Languages


[8]ページ先頭

©2009-2025 Movatter.jp