Closed mikeriley131 closed 5 years ago
@mikeriley131
Did you add youTubeUrl
to options.parserOption.customFields.item
in gatsby-config.js
?
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-source-rss-feed`,
options: {
url: `https://www.gatsbyjs.org/blog/rss.xml`,
name: `GatsbyBlog`,
// Optional
// Read parser document: https://github.com/bobby-brennan/rss-parser#readme
parserOption: {
customFields: {
item: ['itunes:duration']
}
}
}
}
]
}
I didn't. My understanding was that the customFields
object would just be for properties containing a colon (:
). Will try today and see if that makes a difference.
Well that does indeed work. Thank you!
Could you help me understand what needs to go in that customFields
object and what does not?
@mikeriley131 gatsby-source-rss-feed use rss-parser as RSS parser. rss-parser has default fields, so we have to define custom fields.
We can check default fields in this file. https://github.com/bobby-brennan/rss-parser/blob/master/lib/fields.js
Getting
error GraphQL Error Unknown field youTubeUrl on type FeedLibSynRss
after adding a custom field to the RSS XML.query:
snippet of RSS feed:
Are the comments causing the issue? Unfortunately I don't have any control over them.