Skip to content

Commit

Permalink
introduce validation for single reference fields
Browse files Browse the repository at this point in the history
  • Loading branch information
axe312ger committed Jul 28, 2021
1 parent d670466 commit 953c3e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/gatsby-source-contentful/src/generate-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ const unionsNameSet = new Set()

const getLinkFieldType = (linkType, field, schema, createTypes) => {
// Check for validations
const validations = field?.items?.validations
const validations =
field.type === `Array` ? field.items?.validations : field?.validations

if (validations) {
// We only handle content type validations
Expand Down

0 comments on commit 953c3e2

Please sign in to comment.