graphQuery for Content Relationship gives 400 if contact relationship is undefined

Hi, I am seeing an issue currently where if a document has a Content Relationship field to another document type and I use a graphQuery to get the fields from that document, the request gives a 400 error if the content relationship is undefined. This is not the behavior I expect, I would expect the query to still succeed and then I would handle the missing content relationship in my code.

Simplified example, I am working on a page on our marketing site for listing our contact information.

The schema for the Contact page looks similar to this

  title: KeyTextPrismicType
  message: KeyTextPrismicType
  contact_form: ContentRelationship

If the contact_form value is unset, the request fails with this error:
Unable to parse fetch query Invalid fetch parsing Exception.\n\nUnable to find contact_form in contact

Any thoughts as to why this is happening? I've not had this issue before so I am wondering if there was a regression of some type.

Hello, thanks for reaching out.

Make sure that the linked document is published or that you're using the release ref in your queries.

If this doesn't help, could you send us the URL of your repo, the GraphQuery, the name of the Content Relationship, and the names of the related Custom Types?

This will help us reproduce the error.

Hey @jim

We close the threads after a week with no new activity. If this happens and you want to continue the conversation, you can easily flag it to reopen it and add a new comment.


Threads close after a period of inactivity. Flag this thread to re-open it and continue the conversation.