In relay/graphql, how to express a query where the response can be empty. I have a dilemma now that, I can't respond with an empty/null response because id field is required by relay (and possibly other non nullable fields in graphql schema), and I can't send error as it stops my component being rendered.
For example, say I am modelling a relationship hierarchy and has a query like
getSpouse(partnerID: string): Person
and this may be empty for some. So, I do either respond with a null Person object (which I think is not quite possible with relay as Person might have non nullable fields including a globalID), or send an error. It is ok to send error, but I am not sure how to catch this error and continue with rendering relay container. I know hot to get errors in case of mutation but query is processed by relay container and couldn't see an interface to get error and continue loading the component.
Is there a way to catch the query error at the Relay container or pass it down to my component ?