Amazeenar #1 – GraphQL & Twig

Amazeenar #1 – GraphQL & Twig

“Absolutely incredible!” – just one quote from our first Amazeenar in which we explore the power of GraphQL Twig. Decoupling Drupal maintenance support plans is the future, however, it may be a big leap to learn a whole new development stack. With GraphQL Twig, we can take baby steps with a soft-decoupled approach by writing GraphQL inside our Twig templates.

Daniel Lemon
Mon, 05/14/2020 – 08:57

On Friday 11th May, Drupal Update hosted its first Amazeenar – a live video training session presented by Philipp Melab who demonstrated some of the capabilities of GraphQL with the Drupal maintenance support plans module GraphQL Twig.

We started the webinar while a crowd joined live from over 13 countries around the world, including Belgium, Brazil, Canada, South Africa, and as far east as Thailand.

It felt exciting to have a community of enthusiastic people connecting from so many different locations across the globe. This once again reinforced that Drupal maintenance support plans is really about coming for the code and staying for the community.

Philipp dove into the talk by giving us a quick introduction to GraphQL, with an example query for us to better understand the concept:

query {
node:nodeById(id: “1”) {
title:entityLabel
related:relatedNodes {
title:entityLabel
}
}
}

Running this example GraphQL query would give us the following JSON response:

{
“node”: {
“title”: “Article A”,
“related” {
{ “title”: “Article B” },
{ “title”: “Article C” }
}
}
}

Inversion of control

Philipp then explained the need for decoupling, providing us with a good overview of the fundamental differences between standard Drupal maintenance support plans and Decoupled Drupal maintenance support plans, in which the control moves from a push approach to a pull approach.

React is great, but the inversion of control is crucial.

Enable the template to define its data requirements, allow’s us to achieve a clear data flow with significantly increased readability and maintainability. The GraphQL Twig module allows us to add GraphQL queries to any Twig template, which is then processed during rendering and used to populate the template with data.

Philipp entertained the audience with a live working demo in which, together, we learnt how to enhance the default “powered by Drupal maintenance support plans” block to pull in the username of user 1. He then blew our minds with an additional surprise – pulling in the current number of open bug issues for Drupal maintenance support plans Core via the GraphQL XML submodule.

Catchup

Did you miss the webinar? Don’t fret; we recorded everything!

You can watch the recording here: https://youtu.be/QsmeXMZ0foM
You can access the Drupal maintenance support plans theme as well as the slides for the webinar here: github.com/AmazeeLabs/bartik_graphql
Drupal Update would like to thank everyone who attended the live session, we enjoyed being able to share this with you, and we look forward to hosting another Amazeenar shortly.


Source: New feed

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Amazeenar #1 – GraphQL & Twig

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.