Skip to content

Allow the indexer definition function to be async #186

@fracek

Description

@fracek

We should allow the indexer definition function to be async to allow users to fetch any required data from an external service. For example, users may store configuration in an external vault and fetch the values at runtime.

export default async function (runtimeConfig: ApibaraRuntimeConfig) {
  return defineIndexer(StarknetStream)({
    // ...
  });
}

Required changes

Testing

We should update the example to use the async definition. The example should call await (for example an http call to httpbin.org) somewhere before returning the indexer.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions