diff --git a/README.md b/README.md index 6da2a41..e1661f5 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,8 @@ module.exports = { }; ``` +The `transformer` field accepts a function and optionally you may provide an `async` function. + # Feedback This is the very first version of our plugin and isn't yet officially supported. Please leave all your feedback in GitHub issues 😊 diff --git a/gatsby-node.js b/gatsby-node.js index 1941cc2..9b29589 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -43,7 +43,7 @@ exports.onPostBuild = async function( if (result.errors) { report.panic(`failed to index to Algolia`, result.errors); } - const objects = transformer(result); + const objects = await transformer(result); const chunks = chunk(objects, chunkSize); setStatus(activity, `query ${i}: splitting in ${chunks.length} jobs`);