One of the questions I get asked every other week is “Does next-drupal work with GraphQL?” .
Yes. Both the Next.js Drupal module and the next-drupal package work with GraphQL 🥳
Let’s take a look at how we can use DrupalClient to fetch GraphQL data.
Fetching GraphQL data with DrupalClient
We built the DrupalClient on top of the standard Fetch API. This means you can use the DrupalClient.fetch method to make GraphQL requests.
Here’s what a GraphQL query looks like:
PubDate