Skip to content

Filter by date GREATER_THAN_OR_EQUAL to "now" #1240

Open
@simon-olsen

Description

@simon-olsen

I'm using Drupal GraphQL v3 and I simply want to make sure that any article that has a created date that in the future doesn't appear in the query. This is my query...

{
  nodeQuery (
    sort: {
      field: "created",
      direction: DESC,
    },
    filter: {
      conditions: [
        {
          field: "type",
          value: "article",
          operator: EQUAL
        },
        {
          field: "created",
          operator: GREATER_THAN_OR_EQUAL,
          value: "now",
        }
      ]
    }
  ) {
    entities {
      entityLabel
    }
  }
}

However, I still see articles with dates in the future displayed in my query.

I also tried field: "entityCreated", but that (of course) doesn't work. I also simply tried adding the current date manually, but this is not working.

What should my query be to ONLY show articles past the current date/time?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions