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
Provide a way to query for posts before or after a specific time (not just date) #1234
Comments
@kellenmace ya, I actually think it would be better if the input was a timestamp instead of a day/month/year input like it is now. Like, we could accept a timestamp as the input, and let the conversion happen behind the scenes via something like I definitely think this would be valuable for a lot of folks. |
Like, we could deprecate So the query could become:
or something like that. We'd need to specify the format(s) allowed for input. The above example is ISO 8601, for example. |
@jasonbahl Yeah, accepting a timestamp would work beautifully for me. 👍 |
@jasonbahl Just added a PR. Rather than a We had talked about throwing an error if a non-
...and there is no post with an ID of If a non- P.S. Issue number 1234 FTW! |
Dear All It seams that there is no activity for more than one year on this topic. Thank you in advance. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had recent activity. If you believe this issue is still valid, please open a new issue and mark this as a related issue. |
I think this issue shall not be ignored while it is also solved within a PR. This useful feature avoids inefficient calls and responses. |
No worries @rgevrek this is still on the radar for v2, got closed by an overzealous 'stale-bot' 😅 |
sorry, but any updates on this? I really could use this feature... |
yes plsssssss 🙏 |
i need that! |
looking forward to it |
related: #1713 |
In my app, I need the ability to fire off a request every few minutes to the WP backend to get any posts that have beed added or edited since the last time I checked. Currently though, WPGraphQL only supports doing date queries using day, month and year. You can't get more specific than that and narrow it down to a certain hour/minute/second. Example:
WP_Query()
does provide that ability by accepting astrtotime()
compatible string as thebefore
/after
argument. Documentation: https://developer.wordpress.org/reference/classes/wp_query/#date-parametersEven if we want to avoid accepting an arbitrary string like
WP_Query()
does, I think this can still be accomplished by acceptinghour
,minute
, andsecond
input args forbefore
andafter
. Then apps like mine that need to query for published/modified posts on a frequent interval would be able to do so.Who's with me?
The text was updated successfully, but these errors were encountered: