ashhitch / wp-graphql-yoast-seo

This is an extension to the WPGraphQL plugin for Yoast SEO
GNU General Public License v3.0
216 stars 49 forks source link

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

Closed ttstauss closed 1 year ago

ttstauss commented 2 years ago

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()

justlevine commented 2 years ago

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.

robmarshall commented 1 year ago

I am also running into this issue.

macojaune commented 1 year ago

Hi, are there any news on this issue ?

lamuertepeluda commented 1 year ago

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.

ashhitch commented 1 year ago

Thanks @izzygld for taking a look this one