These are the instructions on how to set-up a local development environment.
- PHP 8.1+
- Composer
- Lando 3.0.26+
Lando is a Docker-based tool. It is used to spin the webserver for development, providing:
- WordPress installed
- Gato GraphQL installed and activated
- symlinking to the source code
Clone the monorepo:
git clone https://github.com/GatoGraphQL/GatoGraphQL.gitInstall the dependencies, via Composer:
$ cd PoP
$ composer installBuild the Lando webserver:
composer build-serverIf the process throws an error before installing the WordPress site (it may happen due to unidentified reasons), then run:
composer install-siteTo re-install the WordPress DB with the initial set of data (needed for running integration tests), run:
composer reset-dbThe site will be available under https://gatographql.lndo.site.
To access the wp-admin:
- User:
admin - Password:
admin
To start the server, execute:
composer start-serverBy default, the webserver will have global caching enabled.
To test a change during development, we must manually purge the cache (recommended option to keep the GraphQL server running fast), or directly disable caching.
Cached files are stored under the plugin's cache subfolder.
To purge them, simply delete this folder, or execute the following Composer script:
composer purge-cacheCaching is disabled by setting constant GATOGRAPHQL_DISABLE_CACHING in wp-config.php to true:
define( 'GATOGRAPHQL_DISABLE_CACHING', 'true' );To define this constant, we can execute the following Composer scripts:
$ composer disable-caching
$ composer enable-cachingXDebug is enabled by default, but must be triggered for the specific request. To do so, append param XDEBUG_TRIGGER=1 to the URL:
- In the
wp-admin, in the URL to load the GraphiQL or Interactive schema client - In the URL of any public client, such as the GraphiQL or Interactive schema client attached to:
- the public single endpoint
- a custom endpoint
- To any custom endpoint
- To any persisted query