Skip to content

Commit

Permalink
fix: Don't register NodeWithEditorBlocks interface to null type n…
Browse files Browse the repository at this point in the history
…ames. (#215)
  • Loading branch information
justlevine authored Mar 29, 2024
1 parent e6b4ac4 commit ad03a21
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-deers-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wpengine/wp-graphql-content-blocks": patch
---

fix: Don't register `NodeWithEditorBlocks` interface to `null` type names.
5 changes: 5 additions & 0 deletions includes/Registry/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ static function ( $post_type ) {
},
$supported_post_types
);

// Remove any null values from the array
$type_names = array_filter( $type_names );

register_graphql_interfaces_to_types( [ 'NodeWithEditorBlocks' ], $type_names );

$post_id = -1;
// For each Post type
foreach ( $supported_post_types as $post_type ) {
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ parameters:
count: 1
path: includes/Registry/Registry.php

-
message: "#^Parameter \\#2 \\$type_names of function register_graphql_interfaces_to_types expects array\\<string\\>\\|string, array\\<string\\|null\\> given\\.$#"
count: 1
path: includes/Registry/Registry.php

-
message: "#^Call to an undefined method DiDom\\\\Element\\|DOMElement\\:\\:html\\(\\)\\.$#"
count: 1
Expand Down

0 comments on commit ad03a21

Please sign in to comment.