ashhitch/wp-graphql-yoast-seo

Cannot return null for non-nullable field "MediaItem.id"

ttstauss opened this issue · 5 comments

When running a query for twitterImage?.sourceUrl() I get the following error (when no image has been added to the Twitter preview/Twitter Image section in WordPress):

[GQtyError: Internal server error] {
  graphQLErrors: [
    {
      debugMessage: 'Cannot return null for non-nullable field "MediaItem.id".',
      message: 'Internal server error',
      extensions: [Object],
      locations: [Array],
      path: [Array]
    }
  ]
}

Doesn't seem to be an issue with opengraphImage?.sourceUrl()

Betting it has to do with this, where wpcom_vip_attachment_url_to_postid is returning false causing a 0 to be passed to the loader instead of bailing with null.

I am also running into this issue.

Hi, are there any news on this issue ?

Hi, I had this issue when upgrading from 4.16.0 to 4.22.1. I think this is a regression.
The 4.16.2 seems to work, though. I guess I'm gonna stick to that version.

Thanks @izzygld for taking a look this one