Cannot read property 'url' of undefined


#1

Hi Guys, I have a list of recepies and when I click on one of these I expect to see the details but I get an error: TypeError: Cannot read property 'url' of undefined

Here is my RecipePage:
https://github.com/kstulgys/recipe-box/blob/copyingInstagram/src/components/RecipePage.js

any help appreciated. Thanks


#2

Not sure, if my comment will be relevant, but I would kindly recommend, to post here exact GraphQL query which u have failing. We all can grasp React syntax, but it teks some time to get the ide of whole codebase u have in your repo.

So is this query failing?

mutation CreateVoteMutation($recipeId: ID!) {
    createVote(recipeId: $recipeId) {
      id
      recipe {
        votes {
          id
        }
      }
    }
  }

My point is, if this is related to Graph QL, then I would copy the query, runnin Explorer, and analyze why it’s failing.

But, u can successfully ignore my comments, because I’ve recently joined this forum, so no idea what rules exists here regarding content in post kind of question.