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
Replace DateQueryInput with strings for the dateQuery before and afte… #1239
base: develop
Are you sure you want to change the base?
Replace DateQueryInput with strings for the dateQuery before and afte… #1239
Conversation
…r fields so that strtotime()-compatible strings can be passed in
Deploy request for wpgraphql-docs accepted. Accepted with commit e692197 https://app.netlify.com/sites/wpgraphql-docs/deploys/5e96105748903f00071b829c |
Codecov Report
@@ Coverage Diff @@
## develop #1239 +/- ##
===========================================
+ Coverage 63.78% 63.79% +0.01%
===========================================
Files 165 164 -1
Lines 9529 9510 -19
===========================================
- Hits 6078 6067 -11
+ Misses 3451 3443 -8
Continue to review full report at Codecov.
|
@kellenmace thanks for the PR. I'll try and review shortly and provide my thoughts. 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kellenmace I left some of my high level thoughts on here.
@@ -38,12 +38,12 @@ public static function register_type() { | |||
'description' => __( 'Second (0 to 59)', 'wp-graphql' ), | |||
], | |||
'after' => [ | |||
'type' => 'DateInput', | |||
'description' => __( 'Nodes should be returned after this date', 'wp-graphql' ), | |||
'type' => 'String', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need tighter validation here. I think it would be better to introduce a new DateTime scalar: https://webonyx.github.io/graphql-php/type-system/scalar-types/#writing-custom-scalar-types and use that here instead.
namespace WPGraphQL\Type\Input; | ||
|
||
class DateInput { | ||
public static function register_type() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is probably a pretty widely used input arg, I'd rather see us deprecate the existing field and introduce the new field separately. We could then make the breaking change in a future release.
@kellenmace I've added |
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 would be very useful for us. |
This is a very useful PR, are there any plans to finish and merge? Else many inefficient calls and responses are needed on our side |
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. |
…r fields so that strtotime()-compatible strings can be passed in
What does this implement/fix? Explain your changes.
Replaces
DateQueryInput
with strings for thedateQuery
before
andafter
fields so thatstrtotime()
-compatible strings can be passed in.Test query:
Does this close any currently open issues?
Closes #1234
Any other comments?
WPGRAPHQL RULZ!
Where has this been tested?
Operating System: macOS 10.15.3
WordPress Version: 5.4