Download the PHP package axepress/wp-graphql-plugin-boilerplate without Composer
On this page you can find all versions of the php package axepress/wp-graphql-plugin-boilerplate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download axepress/wp-graphql-plugin-boilerplate
More information about axepress/wp-graphql-plugin-boilerplate
Files in axepress/wp-graphql-plugin-boilerplate
Package wp-graphql-plugin-boilerplate
Short Description Boilerplate for creating WPGraphQL extensions
License GPL-3.0-or-later
Informations about the package wp-graphql-plugin-boilerplate
WPGraphQL Plugin Boilerplate
🚨 NOTE: This is prerelease software. Use at your own risk 🚨
A boilerplate for creating WPGraphQL extensions. Can be used as a Composer dependency or as a tool to scaffold your own plugin.
Inspired by the following projects and their contributors:
Features
- Default folder structure that mirrors WPGraphQL.
- Helper classes, interfaces, methods, and traits to make it easier to register new GraphQL types.
- Dependency management with Composer.
- Code sniffing with PHPCS, WordPress Coding Standards, and Automattic's WordPress VIP Coding Standards
- Static Analysis with PHPStan
- WPUnit Testing with Codeception and WPBrowser.
- Docker image generation.
- Automated CI with Github Actions.
System Requirements
- PHP 7.4+ | 8.0+ | 8.1+
- WordPress 5.4.1+
- WPGraphQL 1.8.0+
Getting Started
As a Composer dependency
We recommend installing this boilerplate using Strauss, to prevent plugin conflicts with other libraries. For more information see this explainer from StellarWP.
1. Add the dependency to your project.
2. Configure Strauss.
-
Add the following scripts to composer .json:
-
Add the strauss config to "extra" in composer.json:
- Include the autoloader in your composer.json's classmap.
As a plugin starter
1. Initialize the plugin
Creating your WPGraphQL plugin is as simple as downloading the project to your machine and running curl -fsSL https://raw.github.com/AxeWP/wp-graphql-plugin-boilerplate/master/bin/install.sh | bash
.
You will be asked to provide the following configuration details, or you can pass them as flags.
- Branch (
--branch
) : The Github branch to use as the source. - Name (
--name
) : The name of your plugin (e.g.My Plugin for WPGraphQL
). - Namespace (
--namespace
): The PHP namespace to be used for the plugin (e.g.MyPlugin
). - Path (
--path
): The path to the directory directory where the plugin should be created (e.g.mysite/wp-content/plugins
). - Prefix (
--prefix
): The plugin prefix (in snake case). This will be used to generate unique functions, hooks and constants (e.g.my_plugin
). - Slug (
--slug
): The slug (in kebab-case) to use for the plugin (e.g.wp-graphql-my-plugin
).
Alternatively, you can download the repository and run composer create-plugin
.
2. Create your .env
file
Rename .env.dist
to .env
, and set the variables to your particular localhost/testing environment.
Project Structure
Roadmap
- Include example files.
- Quality-of-life utils that make it easy to extend WPGraphQL.
- Extensive documentation.
Documentation
@todo
Recipes
@todo