-
Notifications
You must be signed in to change notification settings - Fork 442
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
Issue#8 comment mutations #465
Issue#8 comment mutations #465
Conversation
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.
@kidunot89 thanks so much for working on this!
I left some initial comments on the Composer dependencies and some formatting changes.
I'll pull this down and check things out in more detail and provide more feedback soon.
Thanks!
src/Type/Comment/CommentType.php
Outdated
return $content; | ||
} | ||
|
||
return apply_filters('comment_text', $content); |
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.
@kidunot89 good addition! We need to also support the format
argument for this field then
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 already added support for that. It's there as well
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.
@kidunot89 where? I don't see it in this diff unless I'm overlooking something 🤔 👀
I would expect to see it here with the field definition:
'type' => Types::string(),
'description' => __( 'Content of the comment. This field is equivalent to WP_Comment->comment_content and the value matching the `comment_content` column in SQL.', 'wp-graphql' ),
'args' => [
'format' => [
'type' => // the format enum
'description' => // the description of the enum
]
]
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.
Corrected. I used Types::post_object_field_format_enum() as the type
@@ -57,7 +57,7 @@ public function testPluginQuery() { | |||
'id' => $global_id, | |||
'name' => 'Hello Dolly', | |||
'pluginUri' => 'http://wordpress.org/plugins/hello-dolly/', | |||
'version' => '1.6', | |||
'version' => '1.7', |
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.
we need to change the assertion we're making here so this doesn't cause failures when we test on different versions of WordPress core that ship with different versions of this plugin. I'll create another issue to address this.
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'll write a helper function in the test
@@ -0,0 +1,102 @@ | |||
<?php |
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.
@kidunot89 can you run:
rm -rf vendor
composer install --no-dev
Then push again. We don't want to version the dev dependencies that are used for Unit tests, etc.
Thanks!
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'll do it asap
$mutation_name = 'CreateComment'; | ||
self::$mutation = Relay::mutationWithClientMutationId([ | ||
'name' => $mutation_name, | ||
'description' => __('Create comment objects', 'wp-graphql'), |
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.
Not a huge deal but we mostly try and follow WordPress core code standards in terms of spacing, etc.
If you're using PHPStorm you can easily set the project to use the WordPress code style then reformat the files.
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'm using VSCode but I can use Wordpress spacing from now on and make changes to my code. I kinda hate the spacing because is make reading it from a mobile device kinda unbearable.
@kidunot89 it looks like something is causing the test environment to not get setup properly when Travis-CI runs the tests. I'll pull this locally and check things out and see if we can get it straight. |
…t89/wp-graphql into issue#8-comment-mutations do
closes #8 |
Your checklist for this pull request
Thanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.
🚨Please review the guidelines for contributing to this repository.
What does this implement/fix? Explain your changes.
CommentMutations, CreateComment, UpdateComment, DeleteComment, UntrashComment, and CommentMutationTests
Does this close any currently open issues?
Issue #8
Any relevant logs, error output, GraphiQL screenshots, etc?
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
Any other comments?
I don't believe the CommentConnections are fully implemented. I couldn't figure out how to access the posts through the commentedOn property or the author/user through the author property. The implemention lays outside the scope of the mutations though.
Where has this been tested?
Operating System: Ubuntu 18.04
WordPress Version: 4.9.6