Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for me! πŸ™‹β€β™‚οΈ Await data transformer #40

Merged
merged 2 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 😊
2 changes: 1 addition & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down