CockpitQL
CockpitQL copied to clipboard
Filter by date
I am trying to get latest posts from my collection, but want only to fetch those that are published until this day today. So I want to know how to fetch posts that are released at dates prior till today.
I tried to use the suggestion from this issue, but it doesn't seem to work neither as the $
-sign is not accepted in GraphQL as a key.
{
collection(name:"posts", filter:{published: true, date:{$lt: "2019-03-01"}})
}
query posts($filter: JsonType) {
collection(name:"posts", filter:$filter)
}
with variables:
"filter":{"published": true, "date":{"$lt": "2019-03-01"}