Error with Liftoff IV code

I am at IV.7, where we test the mutation in the explorer. Everything works well as long as we have a valid trackId. As soon as I used the silly id, I get an error from the explorer, about not being able to return a null value for a non-nullable field. I have double checked my code for typos, and still haven’t found any.

Hello @Achintya72,
Could you check if the Track field in the IncrementTrackViewsResponse return type is set as non-nullable track:Track! in your schema? That would explain the error you’ve received in Studio.

That field must be nullable (Track without the !), as if the id is not matching any tracks we should be able to handle that properly with our Response.

Here’s the full correct IncrementTrackViewsResponse type for reference:

  type IncrementTrackViewsResponse {
    code: Int!
    success: Boolean!
    message: String!
    track: Track
  }

Let me know if that helps.

Best,
Raph