gatsby createNodeField based on configOption & best way for multiple plugin calls?

166 views Asked by At

I am working on a custom source plugin and I have 2 issues:

First, I want to create a field in the node my plugin creates, but i want the value of that field to be one of the config options

Something like this

{
  resolve: 'plugin-name',
  options: {
    option1: 'value1'
  },
},

createNodeField({
      name: `field1`,
      node,
      value: configOption1,
    })

Is that possible? And also, whats the best way to do multiple calls of the same plugin? The API I am using forces me to do one request at a time for the data i need, no "overall" request.. is there a better way to do that instead of having {resolve: 'plugin-name', options: {option1} } x-times with different options in my gatsby-config.js?

0

There are 0 answers