javascript - Is it possible to show only posts with dates older than yesterday
问题描述
as the topic says.
I was hoping this could be done w graphql. The documentation shows there's a lt
and gt
operator, but when I try this locally or the graphiql demo, I get an error, saying the operator is not available...
export const IndexPageQuery = graphql`
query {
allEventsJson
#here I was hoping to filter all past events
#(filter: { date:{ gte: { today }}})
#but gte is not accepted and I'm unsure how to set today's date in
#the query (iso8601 date through a JS variable was not accepted)
{
edges {
node {
id
title
date(formatString: "DD-MM-YYYY")
month: date(formatString: "MMM")
day: date(formatString: "DD")
year: date(formatString: "YYYY")
}
}
}
}
`
I have a repository with a demo here
解决方案
推荐阅读
- linux - 为什么有些二进制文件在 Linux 文件系统中重复?
- web-scraping - 如何从网站上从 ESRI Arcgis 抓取/提取数据?
- java - java.lang.IllegalStateException :您指的是实际 Web 请求之外的请求属性
- ajax - 如何将jquery中onchange中的变量值发送到ajax?
- javascript - 如何从黄瓜步骤中捕获正则表达式
- google-apps-script - 为什么 DocumentApp.getUi().alert('blah') 可以在前端提醒?
- clang - 使用 Clang + msm-3.18 Kernel Android Q 构建错误
- microsoft-graph-api - 如何使用 Microsoft Graph API 获取 Teams 中的活动 PSTN 呼叫列表
- java - 如何将 XML 数据发送到当前端点的服务器
- javascript - *ngFor 内的角度内容投影是否共享相同的数据?如何从父组件访问子组件的项目内容?