os version: windows 10 (10.0.15063 Build 15063)
node version: v8.4.0
gatsby version: 1.9.108
gatsby-source-contentful version: 1.3.17
Production build breaks with a graphql schema error when Contentful optional field is empty in all entries.
success update schema — 0.100 s
⠂ extract queries from componentsTrace: GraphQLParser: Unknown field `price` on type `ContentfulGiftBox`. Source: document `boxQuery` file: `GraphQL request`.
at graphqlError (C:\Projects\Supagifts\node_modules\gatsby\dist\internal-plugins\query-runner\graphql-errors.js:196:11)
...
gatsby build and note that site builds as expected.gatsby build and note that the site build fails.I've started investigating this on a local PR branch, but need a little assistance in choosing an approach to fix, as I'm very new to graphql. Options:
entryItemFields[entryItemFieldKey]) from null to an empty string or other flagged value.There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues as many of them have already been resolved with the latest updates or explained in a previous issue.
Feel free to open a new one if you still experience this problem or a similar one! 👍
I think it's fine to close this one. Issue #4847 is the same thing and it links to #4261 and #3344.
Hey Folks,
I haven't tested this but this might be a p[otential Clean workaround that does not require creating dummy content.
https://medium.com/@Zepro/contentful-reference-fields-with-gatsby-js-graphql-9f14ed90bdf9
@Khaledgarbaya Doesn't seem to work with a single reference type (rather than one-to-many) since the field (contentSections in the example) doesn't exist in the schema at all.
+1 watching this
I'm also having this issue.
Also having this issue
Same here, deleting a post on contentful breaks the app. Any workarounds?
Running into this issue as well.
Most helpful comment
Hey Folks,
I haven't tested this but this might be a p[otential Clean workaround that does not require creating dummy content.
https://medium.com/@Zepro/contentful-reference-fields-with-gatsby-js-graphql-9f14ed90bdf9