Making a graphql query field optional and not have it break build. #33309
-
Please help me with making a graphql query field optional and not have it break build.
More information: I am trying to render richText format from contentful which returns the embedded assets as references, and if no embedded image is found within the post then gatsby build breaks. Please help me have the references field set as an optional field. I tried everything I could and cannot seem to fix the issue |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found the solution it was to add @link to references |
Beta Was this translation helpful? Give feedback.
Found the solution it was to add @link to references
references: [ContentfulAsset] @link(by: "id", from: "references__NODE")