CockpitQL icon indicating copy to clipboard operation
CockpitQL copied to clipboard

Filter by date

Open Ximore opened this issue 5 years ago • 1 comments

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"}})
}

Ximore avatar Feb 28 '19 16:02 Ximore

query posts($filter: JsonType) {
  collection(name:"posts", filter:$filter)
}

with variables:

"filter":{"published": true, "date":{"$lt": "2019-03-01"}

aheinze avatar Sep 06 '19 22:09 aheinze