Skip to content

Extend the Drupal 8 GraphQL module to support querying by routes

License

Notifications You must be signed in to change notification settings

thaiphan/graphy-routes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphy Routes

This simple Drupal GraphQL V4 extension allows you to retrieve the URLs for all your nodes. You can filter by bundle. Very useful for projects that require static site generation!

Installation

You can install using Composer.

composer require thaiphan/graphy-routes

Usage

Use the following syntax to retrieve the URL for your nodes:

query {
  routes(bundles: ["article", "page"]) {
    total
    items {
      url
    }
  }
}

You will get the following response:

{
  "data": {
    "routes": {
      "total": 3,
      "items": [
        {
          "url": "/node/1"
        },
        {
          "url": "/contact-us"
        },
        {
          "url": "/the-best-dabs-of-2020"
        }
      ]
    }
  }
}

About

Extend the Drupal 8 GraphQL module to support querying by routes

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages