First off, great work with this tutorial! Thank you for all your effort.
I thought I would mention a problem I was having and what I did to resolve it in case others have the same issue.
I had been running into this error: TypeError: Cannot destructure property wpgraphql of 'undefined' or 'null'
I traced it back to the PostTemplateFragment and BlogPreviewFragment within the data.js file. Apparently, sourceUrl under 'FeaturedImage' as well as name and slug under 'author' need to be wrapped in 'node'. Example:
featuredImage {
node {
sourceUrl
}
}
and
author {
node {
name
slug
}
}
Perhaps this is the result of a breaking change to wpgraphql?
After adjusting those fragments the project built successfully again.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
First off, great work with this tutorial! Thank you for all your effort.
I thought I would mention a problem I was having and what I did to resolve it in case others have the same issue.
I had been running into this error:
TypeError: Cannot destructure property
wpgraphql
of 'undefined' or 'null'I traced it back to the PostTemplateFragment and BlogPreviewFragment within the data.js file. Apparently, sourceUrl under 'FeaturedImage' as well as name and slug under 'author' need to be wrapped in 'node'. Example:
and
Perhaps this is the result of a breaking change to wpgraphql?
After adjusting those fragments the project built successfully again.