This demo web site is built with:
- Gatsby 2.x static suite builder, including:
- CSS Modules for styling
- the
gatsby-source-graphql
plugin, which uses schema stitching to merge 3rd party GraphQL schemas.
- Drupal 8.7.x content management system, including:
- the Umami install profile with multi-lingual demo content
- the GraphQL 3.x module with a GraphQL endpoint exposing Drupal content
This is an experiment to try to out the integration between Gatsby and Drupal using the GraphQL module instead of the JSON:API module. There is lots of work being done with the JSON:API and experimenting with the GraphQL module should help to highlight the pros and cons of both approaches.
Discussions and code improvements are welcome!
Specifically, we would like to:
- Create a
using-drupal-graphql
example, using the Drupal GraphQL 8.x-3.0 module, that goes into Gatsby's git repo along side the Drupal-core-onlyusing-drupal
example. - Upgrade the demo to use GraphQL 8.x-4.0 module (once it's released).
There's lots of different "easy-to-setup development environments". This demo site uses drush to serve the website. You don't have to use drush; you just need a Drupal 8.7.x website installed with the Umami install profile and the Drupal GraphQL. Then can use the Gatsby files in this demo with the website you've setup; just change the URL configured in gatsby-config.js
.
- Install the Drush launcher. Alternatively, when the installation instructions say to run
drush
, run./vendor/bin/drush
instead. - Install Composer.
- Clone this repository using a recent version of Git. (If you are using an older version of Git, you will also need to run
git submodule init
andgit submodule update
after you clone the repo.) - Go into the
backend
folder where you can complete all of the following steps. - Copy the
backup/files
folder toweb/sites/default
. i.e. The copy of the folder will now be located atbackend/web/sites/default/files
. - Setup the Drupal install with
composer install
- Start the Drupal site with
drush serve
- Optionally,
drush uli --uri http://127.0.0.1:8888
will load the site in your browser and log you in as admin.
-
Go into the
frontend
directory and runnpm install
-
Use
npm run
to show a list of commands available. -
Use
npm run start
to start the web and Gatsby development servers. You should see the following:You can now view gatsby-starter-default in the browser. http://localhost:8000/ View GraphiQL, an in-browser IDE, to explore your site's data and schema http://localhost:8000/___graphql