-
Notifications
You must be signed in to change notification settings - Fork 642
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
GraphQL : >= now
is not showing entries where date is set to today
#10485
Comments
I'm unable to reproduce this locally on Craft 3.7.30.1 Please, keep in mind, that, if you're using this on the What version did you update from? |
I just updated the project to 3.7.30.1 but the problem is still there. with a custom date field as well as for postDate/dateCreated. the last version where this was working for sure was 3.6.17. after this this bug might already been there but was unnoticed. Updates
|
Can you share the full query you are executing? |
entries(dateCreated: ">= now") {
title
id
}
sundays: categories(group: "sunday", orderBy: "date", date: ">= now") {
id
language
title
... on sunday_Category {
date @formatDateTime(timezone: "Europe/Berlin")
timezone: date @formatDateTime(format: "O", timezone: "Europe/Berlin")
selectedColor {
... on color_Category {
hex
}
}
}
} |
I cleared all cashes and re-applied the full config file just to be sure. nothing changes. |
Probably not easy to find entries that will be created in the future or at this instant. Maybe you're looking for I'll look into that second query. |
you are right, the example does not make sense with dateCreated. this is the query (where sundays: categories(group: "sunday", orderBy: "date", date: ">= now") {
id
language
title
... on sunday_Category {
date @formatDateTime(timezone: "Europe/Berlin")
timezone: date @formatDateTime(format: "O", timezone: "Europe/Berlin")
selectedColor {
... on color_Category {
hex
}
}
}
} |
Hmm, still unable to reproduce this. Thought that maybe something changed and Is it possible to send over a DB dump and your |
@benediktblank Date fields always store date + time, and the time is defaulted to midnight in the system time zone (converted to whatever the UTC equivalent is), if not set explicitly via the “Show date and time” option.
Because like Date field values, The following are all identical:
All inputted dates are assumed to be set it the system time zone (Settings → General → Time Zone), unless explicitly set to another time zone (e.g. if the date field’s “Show Time Zone” setting is enabled, or the GraphQL param value specifies a time zone).
Probably because |
@brandonkelly This means the only way to query for events on the current day would be to get the day-string via the frontend and use it as a query? query GetEntriesUpdatedToday($today:String){
entries(orderBy: "dateUpdated DESC", dateUpdated: [$today]) {
dateUpdated
title
}
} with params {
"today": ">= 2022-08-17"
} Is there a reason why twig filters are not allowed in the query string? Only thing I can guess right now is cache reasons (as the query is not changing for now it would mean the query could return an older result)!? With twig filters enabled it would be possible to use the same syntax as in normal queries themselves like |
Just resolved this for Craft 4.3: going forward, date params for both element queries and GraphQL will support
Because Twig and GraphQL are two completely different languages. |
Great to hear. Regarding twig in graphQL: I meant that the string (QueryArgument) gets parsed as twig when the query is received in Craft. But yes, would probably makes things confusing Mixing both languages. |
Craft 4.3 was released earlier this week with those changes! |
Description
I found an issue with an running project that was updated to 3.7.25.1 a while back. Before the update, we were able to query entries by a date field to show only entries where the date is today or in the future with
>= now
.This is not working anymore.
The feature was introduced back in 3.7.0 after my initial issue #9117.
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: