-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
fix: Connections need to connect to Types that implement the Node interface #675
fix: Connections need to connect to Types that implement the Node interface #675
Conversation
- move id resolver from product-attribute interface to the specific types
- update test to check for falsy vs null
- register the fields to the Product Interface
@kidunot89 this is pretty close. There's still a broken test related to filters on the Product post type. We need to figure out a different filter(s) for these filters: https://github.com/wp-graphql/wp-graphql-woocommerce/blob/develop/includes/class-core-schema-filters.php#L91-L117 |
@@ -23,6 +23,7 @@ public static function register_interface( &$type_registry ) { | |||
'Attribute', | |||
[ | |||
'description' => __( 'Attribute object', 'wp-graphql-woocommerce' ), | |||
'interfaces' => [ 'Node' ], |
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.
Spaces must be used to indent lines; tabs are not allowed
@@ -23,6 +23,7 @@ public static function register_interface( &$type_registry ) { | |||
'ProductAttribute', | |||
[ | |||
'description' => __( 'Product attribute object', 'wp-graphql-woocommerce' ), | |||
'interfaces' => [ 'Node' ], |
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.
Spaces must be used to indent lines; tabs are not allowed
}, | ||
] | ||
); | ||
public static function register_interface() { |
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.
Spaces must be used to indent lines; tabs are not allowed
}, | ||
] | ||
); | ||
public static function register_interface() { |
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.
Method name "Product::register_interface" is not in camel caps format
}, | ||
] | ||
); | ||
public static function register_interface() { |
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.
Opening brace should be on a new line
); | ||
public static function register_interface() { | ||
|
||
// Register the fields to the Product Interface |
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.
Spaces must be used to indent lines; tabs are not allowed
public static function register_interface() { | ||
|
||
// Register the fields to the Product Interface | ||
// the product interface is defined by the post_type registration |
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.
Spaces must be used to indent lines; tabs are not allowed
|
||
// Register the fields to the Product Interface | ||
// the product interface is defined by the post_type registration | ||
register_graphql_fields( 'Product', self::get_fields() ); |
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.
Spaces must be used to indent lines; tabs are not allowed
|
||
// Register the fields to the Product Interface | ||
// the product interface is defined by the post_type registration | ||
register_graphql_fields( 'Product', self::get_fields() ); |
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.
Space after opening parenthesis of function call prohibited
|
||
// Register the fields to the Product Interface | ||
// the product interface is defined by the post_type registration | ||
register_graphql_fields( 'Product', self::get_fields() ); |
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.
Expected 0 spaces before closing bracket; 1 found
Code Climate has analyzed commit f6bc929 and detected 287 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 66.1% (50% is the threshold). This pull request will bring the total coverage in the repository to 74.2% (-2.0% change). View more on Code Climate. |
What does this implement/fix? Explain your changes.
This PR Implements the "Node" interface on any Type that is used as a toType in a connection, as Connections need to connect to Node types
This PR implements the Node interface on these types, but does not handle the resolution of the ID field on each type, nor the resolution of a
node( id: $id ) { ... }
queryMy goal is to unblock users, and we can finesse some of those details as follow-up PRs
Does this close any currently open issues?
closes #673