| @@ -124,9 +124,14 @@ | ||
| 124 | 124 | */ |
| 125 | 125 | private function register_fields(): void { |
| 126 | 126 | $resolve = function ( \WPGraphQL\Model\Post $graphql_post ) { |
| 127 | 127 | $post_id = $graphql_post->ID; |
| 128 | - $post = WP_Post::get_instance( $post_id ); | |
| 128 | + | |
| 129 | + if ( ! is_int( $post_id ) ) { | |
| 130 | + return null; | |
| 131 | + } | |
| 132 | + | |
| 133 | + $post = WP_Post::get_instance( $post_id ); | |
| 129 | 134 | |
| 130 | 135 | if ( false === $post ) { |
| 131 | 136 | return null; |
| 132 | 137 | } |