Progressively decouple Drupal 8 with GraphQL and Twig

conference: Drupalcon Global 2020, North America, online

GraphQL in Twig queries additional data from the backend

This session will present a beginner’s guide and demo on how to use GraphQL in Twig. Decoupled Drupal is the future, but learning an entirely new stack can be daunting. Writing GraphQL inside Twig templates gives developers a path to an accessible progressive-decoupled approach.

This session will introduce GraphQL queries and demonstrate the advantages of changing the Drupal push model to a pull model by letting the twig template define its data requirements including:

  • Clearer data flow
  • Increased readability
  • Improved maintainability

Learning Objectives

  • Use Drupal GraphQL module to query content.
  • Write GraphQL queries in / alongside Twig templates as well as create dynamic lists & displays of content with GraphQL Views module.
  • Consume GraphQL data in Twig or prepare for other frameworks like React.