fix: output list:$type keys for Root fields that return a listOf Nodes#2861
Conversation
list:$type keys for Root fields that return a listOf Nodes
| return $type; | ||
| } | ||
|
|
||
| return null; |
There was a problem hiding this comment.
Avoid too many return statements within this method.
|
|
||
| $to_type = $field_def->config['toType'] ?? null; | ||
| if ( empty( $to_type ) ) { | ||
| return null; |
There was a problem hiding this comment.
Avoid too many return statements within this method.
| return null; | ||
| } | ||
|
|
||
| return $to_type; |
There was a problem hiding this comment.
Avoid too many return statements within this method.
| return null; | ||
| } | ||
|
|
||
| return $type; |
There was a problem hiding this comment.
Avoid too many return statements within this method.
| } | ||
|
|
||
| if ( ! $is_list_type ) { | ||
| return null; |
There was a problem hiding this comment.
Avoid too many return statements within this method.
| * | ||
| * @return \GraphQL\Type\Definition\Type|String|null | ||
| */ | ||
| public function get_wrapped_field_type( Type $type, FieldDefinition $field_def, $parent_type, bool $is_list_type = false ) { |
There was a problem hiding this comment.
Function get_wrapped_field_type has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
|
Code Climate has analyzed commit 18da2f0 and detected 6 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
What does this implement/fix? Explain your changes.
This fixes a regression to the 1.14.5 release where
list:$typekeys are no longer being output for RootQuery fields that return a listOf Nodes.Does this close any currently open issues?
closes #2860
related: wp-graphql/wp-graphql-smart-cache#228
Any other comments?
Given the following snippet:
I could query for
testListOfPosts:Before
We do not see
list:postin the keysAfter
We DO see
list:postin the keys