Download the PHP package hsimah-services/wp-graphql-facetwp without Composer
On this page you can find all versions of the php package hsimah-services/wp-graphql-facetwp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hsimah-services/wp-graphql-facetwp
More information about hsimah-services/wp-graphql-facetwp
Files in hsimah-services/wp-graphql-facetwp
Package wp-graphql-facetwp
Short Description WPGraphQL integration for FacetWP
License GPL-3.0-or-later
Informations about the package wp-graphql-facetwp
WPGraphQL for FacetWP
Adds WPGraphQL support for FacetWP.
- Join the WPGraphQL community on Slack.
-
Documentation
Overview
This plugin exposes configured facets through the graph schema. Once registered for a type, a query is available. The payload includes both facet choices and information and a connection to the post type data. This allows for standard GraphQL pagination of the returned data set.
This plugin has been tested and is functional with SearchWP.
System Requirements
- PHP 7.4-8.1.x
- WordPress 5.4.1+
- WPGraphQL 1.6.0+ (1.9.0+ recommended)
- FacetWP 4.0+
Quick Install
- Install & activate WPGraphQL.
- Install & activate FacetWP.
- Download the
wp-graphql-facetwp.zip
file from the latest release upload it to your WordPress install, and activate the plugin.
[!IMPORTANT]
Make sure you are downloading the
wp-graphql-facetwp.zip
file from the releases page, not theSource code (zip)
file nor a clone of the repository.If you wish to use the source code, you will need to run
composer install
inside the plugin folder to install the required dependencies.
With Composer
Updating and Versioning
As we work towards a 1.0 Release, we will need to introduce numerous breaking changes. We will do our best to group multiple breaking changes together in a single release, to make it easier on developers to keep their projects up-to-date.
Until we hit v1.0, we're using a modified version of SemVer, where:
- v0.x: "Major" releases. These releases introduce new features, and may contain breaking changes to either the PHP API or the GraphQL schema
- v0.x.y: "Minor" releases. These releases introduce new features and enhancements and address bugs. They do not contain breaking changes.
- v0.x.y.z: "Patch" releases. These releases are reserved for addressing issue with the previous release only.
Development and Support
WPGraphQL for FacetWP was initially created by Hamish Blake. Maintainance and development are now provided by AxePress Development. Community contributions are welcome and encouraged.
Basic support is provided for free, both in this repo and at the #facetwp
channel in WPGraphQL Slack.
Priority support and custom development is available to AxePress Development sponsors.
Usage:
Registering a facet to WPGraphQL
It is assumed that facets have been configured.
To register a FacetWP query in the WPGraphQL schema for a WordPress post type (eg post
) simply call the following function:
This will create a WPGraphQL postFacet
field on the RootQuery
. The payload includes a collection of queried facets
and a posts
connection. The connection is a standard WPGraphQL connection supporting pagination and server side ordering. The connection payload only includes filtered posts.
Example query
Note This is not a complete list of GraphQL fields and types added to the schema. Please refer to the WPGraphiQL IDE for more queries and their documentation.
WooCommerce Support
Support for WooCommerce Products can be added with following configuration:
Limitations
Currently the plugin only has been tested using Checkbox, Radio, and Sort facet types. Support for additional types is in development.
Testing
- Update your
.env
file to your testing environment specifications. - Run
composer install-test-env
to create the test environment. - Run your test suite with Codeception.
E.g.
vendor/bin/codecept run wpunit
will run all WPUnit tests.