Skip to content

Conversation

@izzygld
Copy link
Contributor

@izzygld izzygld commented Apr 18, 2023

Screenshot 2023-04-18 at 9 29 40

Fixing:

ErrorException
Warning: Attempt to read property "post_type" on null.

Solution:

The error message you are seeing suggests that the $post object is null, which means that it was not able to retrieve the post object using the get_post() function.

Here are a few things you can try to resolve this issue:

Check if $post_id is valid: Make sure that $post_id is a valid post ID. You can check if it is by using the post_exists() function:

@jasonbahl jasonbahl merged commit 35f835c into wp-graphql:main Apr 18, 2023
@izzygld izzygld deleted the fixpostnull branch April 19, 2023 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants