Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date Filters not returning any result for Equals Filter #1035

Closed
gmiserez opened this issue Aug 26, 2019 · 2 comments
Closed

Date Filters not returning any result for Equals Filter #1035

gmiserez opened this issue Aug 26, 2019 · 2 comments
Milestone

Comments

@gmiserez
Copy link
Contributor

Hello,

We're using the HotChocolate PRISMA-like filters on top of a Mongo IQueryable.
We're currently experiencing an issue when filtering on the exact date.

To Reproduce
A sample repository is available here:
https://github.com/gmiserez/HotChocolate_DateFilterWithMongoIssue

This query returns all the concerts:

{
  blackSabbath2019Tour(where: { concertDate_gte: "2019-01-01" }) {
    concertDate
    name
  }
}

the returned concerts:

{
  "data": {
    "blackSabbath2019Tour": [
      {
        "concertDate": "2019-06-01",
        "cityName": "Amsterdam"
      },
      {
        "concertDate": "2019-07-10",
        "cityName": "Berlin"
      },
      {
        "concertDate": "2019-06-18",
        "cityName": "Paris"
      },
      {
        "concertDate": "2019-03-15",
        "cityName": "Zürich"
      }
    ]
  }

But this query doesn't return the concert that's taking place on that particular day:

{
  blackSabbath2019Tour(where: {concertDate: "2019-06-01"}){
    concertDate
    cityName: name
  }
}

Expected behavior
The following item should be returned for the second query:
{
"concertDate": "2019-06-01",
"cityName": "Amsterdam"
}

Packages:

  • HotChocolate.* 11.0.0-preview.4
  • MongoDB.Driver 2.8.1

Additional context
Could this be an issue with UTC vs Local dates comparisons? I'm living in the CET zone.

@gmiserez gmiserez changed the title Date Filters not returning any result on Equals Filter Date Filters not returning any result for Equals Filter Aug 26, 2019
@michaelstaib michaelstaib added this to the 10.1.0 milestone Aug 26, 2019
@michaelstaib michaelstaib modified the milestones: 10.1.0, 10.2.0 Sep 13, 2019
@michaelstaib
Copy link
Member

This one works now in V11 and V10

@michaelstaib
Copy link
Member

#1170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants