thaiphan/graphy_routes

扩展 Drupal 8 GraphQL 模块以支持按路由查询

安装: 16

依赖项: 0

建议者: 0

安全: 0

星星: 1

关注者: 1

分支: 0

开放问题: 0

类型:drupal-module

v1.1.0 2020-05-30 13:29 UTC

This package is auto-updated.

Last update: 2024-09-29 05:36:23 UTC


README

这个简单的 Drupal GraphQL V4 扩展允许您检索所有节点的 URL。您可以按包进行筛选。对于需要静态网站生成的项目非常有用!

安装

您可以使用 Composer 进行安装。

composer require thaiphan/graphy-routes

使用方法

使用以下语法检索您节点的 URL

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

您将得到以下响应

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