Plugin for creating Ical
nodes from the remote file.
npm install --save gatsby-source-ical
// In your gatsby-config.js
module.exports = {
plugins: [
// You can have multiple instances of this plugin
// to read source nodes from different remote files
{
resolve: `gatsby-source-ical`,
options: {
name: `events`,
url: `https://web-standards.ru/calendar.ics`,
},
},
],
}
You can query calendar nodes like the following:
{
allIcal {
edges {
node {
start
end
summary
}
}
}
}
To filter by the name
you specified in the config, use sourceInstanceName
:
{
allIcal(filter: { sourceInstanceName: { eq: "events" } }) {
edges {
node {
start
end
summary
}
}
}
}