gatsby-source-strapi icon indicating copy to clipboard operation
gatsby-source-strapi copied to clipboard

suggest collectionTypes/singleTypes can set a async/await function

Open zsrl opened this issue 4 years ago • 0 comments

Because I have a lot of data, I want to classify and query the data, but there are also a lot of classifications. I need to take the classifications from the database and mark the ID of each classification respectively. Therefore, I think I need a async/await function here.

{
  resolve: "gatsby-source-strapi",
  options: {
    apiURL: "http://localhost:1337",
    collectionTypes: async () => {
      reurn await myFetchFunc()  // fetching data
    },
    queryLimit: 1000,
  }
}

zsrl avatar Aug 10 '21 14:08 zsrl