Extend
Extending and Configuring Drupal for web applications can be challenging at first and requires many adjustments. However, recipes simplify the process by offering a set of ready-to-install configurations to be applied to your installation.
Making Drupal ready to use as a headless CMS is not the exception, and for this reason, recipes are the best way to help you start your next Drupal decoupled implementation.
Preparing Drupal
Section titled “Preparing Drupal”This guide shows how to install a Drupal decoupled recipe according to the recipes Initiative
We will follow as guide a setup using drupal/recommended-project as a template for illustration purposes.
Configure composer.json
Section titled “Configure composer.json”Some modules of our recipes are still in active development; for this reason, changing the minimum-stability of composer is necessary to download all dependencies.
ddev composer config minimum-stability --merge --json "dev"lando composer config minimum-stability --merge --json "dev"Ignoring downloaded recipes
Section titled “Ignoring downloaded recipes”If you start a git repository of your project, you will find that the recipe is downloaded, and since this is managed by composer, you’ll want to exclude the /recipes path.
echo "/recipes" >> .gitignoreRequire the recipe
Section titled “Require the recipe”ddev composer require octahedroid/drupal-decoupled-graphql-basic-recipe^2lando composer require octahedroid/drupal-decoupled-graphql-basic-recipe^2Applying the recipe
Section titled “Applying the recipe”Recipes are applied using core’s PHP Drupal script. In your CLI, cd into your webroot, and run the following command:
ddev drush recipe ../recipes/drupal-decoupled-graphql-basic-recipelando drush recipe ../recipes/drupal-decoupled-graphql-basic-recipeDrupal Decoupled recipes
Section titled “Drupal Decoupled recipes”Here is a set of recipes according to the recipes initiative, designed to configure Drupal as a headless CMS ready to be integrated with a Frontend application.
- drupal-decoupled-graphql-advanced-recipe: Advanced recipe, this is a turnkey and ready to use solution.
- drupal-decoupled-graphql-basic-recipe: Basic recipe, this is a starting point based on the standard installation profile.