TypeError: Cannot read properties of null (reading 'url') Nextjs

370 views Asked by At

I'm studying from https://www.youtube.com/watch?v=Dc7LAgqy1_E

I got this problem I use hygraph to connect my blog website and at coverPhoto is a mistake

I tried to fix this as t think my hygraph is not published but I already published it also I copy API from youtube tutorial and it working for me but my API is not working

<Image  src={coverPhoto.url} alt=""/>

and I use `` for coverPhoto.url image is not sent error but does not show image too.

I want the image to be shown on the website.

this is my API playground

 query{
  posts{
    title,
    datePublished
    coverPhoto{
      url
    }
  }
}
0

There are 0 answers