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

Variables parsing: Issue with nested DateTime Fields in variables #1037

Closed
gmiserez opened this issue Aug 27, 2019 · 7 comments
Closed

Variables parsing: Issue with nested DateTime Fields in variables #1037

gmiserez opened this issue Aug 27, 2019 · 7 comments
Assignees
Milestone

Comments

@gmiserez
Copy link
Contributor

Hello,
We've noticed issues when passing filter values as complex variables in GraphQL Queries.

To Reproduce
A demo Api is available on the following Repository : https://github.com/gmiserez/HotChocolate_Demo

Here are our queries:

query allConcertsOf2019 {
  blackSabbath2019Tour(where: { concertDate_gte: "2019-06-01" }) {
    concertDate
    cityName: name
  }
}
query allConcertsOf2019WithVariable($where: CityFilter) {
  blackSabbath2019Tour(where: $where) {
    concertDate
    cityName: name
  }
}

with the following variables:

{
  "where": {
    "concertDate_gte": "2019-06-01"
  }
}

Expected behavior
Both queries should return the same result (a list of concerts).

Obtained behavior
The second query returns an Unexpected Execution Error:

"Unable to convert type from String to DateTime

Versions:

  • HotChocolate.* 11.0.0-preview.4
  • MongoDB.Driver 2.8.1
@michaelstaib michaelstaib added this to the 10.1.0 milestone Aug 27, 2019
@michaelstaib michaelstaib modified the milestones: 10.1.0, 10.2.0 Sep 13, 2019
@PascalSenn PascalSenn self-assigned this Oct 2, 2019
@PascalSenn
Copy link
Member

@michaelstaib I'm not sure if this is related to the filters directly

@michaelstaib
Copy link
Member

Ah, you could be right ... since they are represented as string literal ...

@PascalSenn
Copy link
Member

I'm not sure if this solves the problem 👀

@michaelstaib
Copy link
Member

@PascalSenn This one should be working now.... I think I will merge the fix into your branch since yours has the tests.

@michaelstaib
Copy link
Member

michaelstaib commented Oct 28, 2019

This one now fixed on V11.

@michaelstaib
Copy link
Member

I have ported the fix to V10 #1170

@michaelstaib
Copy link
Member

I am closing this issue now.

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

3 participants