I'm using Strapi with GraphQL. I need to query articles that have the publish date after the current date. The intention behind this is to allow editors to publish with future dates so they can plan ahead. Right now I have only this:
export const ARTICLES_QUERY = gql`
query Articles {
articles(where: { display: true }) {
id
slug
title
publish
display
time_to_read
article_categories {
slug
title
}
user {
username
name
}
cover {
url
}
}
}
`
I think I need something like this:
export const ARTICLES_QUERY = gql`
query Articles($today: String!) {
articles(where: { display: true, publish >= $today }) {
id
slug
...
The format of that string is Strapi's default for the date time input and the result is "publish": "2020-02-28T02:00:00.000Z"
I'm aware this is not the way to go, but it illustrates what I need to acomplish.