graphql - 如何查询仅显示上周的帖子
问题描述
在我与 Gatsby 的 drupal 8 解耦项目中,我想使用 graphql 查询帖子进行过滤。我正在使用 json-api 模块。我只想要在 Gatsby 中查询上周帖子的输出。所以我需要类似的东西:
allNodePosts(filter: {date: {eq: "between today and last seven days"}}) {
edges {
node {
body {
value
}
}
}
这可以用graphql吗?如果是的话,查询应该是什么样子?
解决方案
推荐阅读
- python - Python中的类变量和实例变量
- javascript - 列中的 JS 条件模板
- php - wp-admin/admin-AJAX 403 禁止
- ios - 如何在 WKWebview 中添加观察者以播放和暂停音频文件的操作?
- flutter - 在 CupertinoTabBar 视图内外导航
- google-cloud-platform - 聚合时是否可以使堆栈驱动程序监视不填充时间序列间隙
- typescript - 为什么 Typescript 将 `object.hasOwnProperty("key")` 视为与 `"key" in object` 本质上不同
- sql - SQL - XML - 在子查询中创建多个具有相同名称的节点
- c++ - Wincrypto (CNG):无法使用任何 CNG 算法创建证书
- maps - 将像素转换为 Mapbox 地图上的坐标