Unresolved issue from @0xsven that appeared in #4401 but is not fixed by #4429.
The issue appears to be related to an entity with multi-relation field containing only missing entities. This occurs when a referenced entity is deleted by the user on Contentful.

As such, the plugin is returning a entity node that contains a field fieldname_NODE with an empty array that causes [gatsby]/dist/schema/infer-graphql-input-fields.js:239:38 to access a field on an undefined node.
TypeError: Cannot read property 'internal' of null
- infer-graphql-input-fields.js:238
[test-gatsby-contentful]/[gatsby]/dist/schema/infer-graphql-input-fields.js:238:38
- lodash.js:4917 isBind
[test-gatsby-contentful]/[lodash]/lodash.js:4917:15
- lodash.js:3002 baseForOwn
[test-gatsby-contentful]/[lodash]/lodash.js:3002:24
- lodash.js:4886 index
[test-gatsby-contentful]/[lodash]/lodash.js:4886:18
- lodash.js:9334 Function.forEach
[test-gatsby-contentful]/[lodash]/lodash.js:9334:14
- infer-graphql-input-fields.js:225 inferInputObjectStructureFromNodes
[test-gatsby-contentful]/[gatsby]/dist/schema/infer-graphql-input-fields.js:225:5
- build-node-types.js:88 _callee$
[test-gatsby-contentful]/[gatsby]/dist/schema/build-node-types.js:88:36
- next_tick.js:131 _combinedTickCallback
internal/process/next_tick.js:131:7
- From previous event:
- build-node-types.js:266 _callee2$
[test-gatsby-contentful]/[gatsby]/dist/schema/build-node-types.js:266:26
- index.js:38 _callee$
[test-gatsby-contentful]/[gatsby]/dist/schema/index.js:38:18
I used 0xsven's test project from #4401.
But these steps should reproduce the error in any project:
Create entry and link and create a new entry.Action > Delete and delete the new entry, and accept the popup window.gatsby develop.I have this issue. Do you know of any way I can tidy up the broken entities manually in Contentful in the mean time?
This tool did the trick for me: https://github.com/contentful/contentful-link-cleaner
I have tried contentful-link-cleaner and it has found 16 broken links and 3 unresolved errors.
Contentful should maybe work on their example project.
After running contentful-link-cleaner my gatsby setup works fine again!
@tremby Having the same issue in my contentful links. When I run the contentful-link-cleaner I get an error. Did you only need your spaceId and accessToken to run it?
@m2mathew: sorry, but I don't remember.
@m2mathew needed spaceId, deliveryToken, managementToken
Most helpful comment
This tool did the trick for me: https://github.com/contentful/contentful-link-cleaner