How do I detect GQL query not found

I’m new to ReScript and struggling with problem below. Component is supposed to retrieve an image from a database based upon it’s “messageId” key and it works but not if the messageID is not found. I think the error is related to shape of response from GraphQL server but I’m not sure how to trap for it. I’m using ReasonRelay (rather than graphql_ppx) and I think there are functions generated to help convert from JSON to pure types and perhaps that might be the fix, but am confused about that also. Would appreciate any advice to help me move on to next steps. Thanks!