The apiRunInstance Object

Because some API calls in Gatsby can take longer to finish than others, every time an API is invoked, the Gatsby bootstrap creates an object called apiRunInstance to track the call. This object contains the fields listed in Table 14-2.

FieldDescription
idA unique identifier generated based on the type of API invoked
apiThe API being invoked; e.g., onCreateNode
argsAny arguments passed to api-runner-node; e.g., an individual Node object
pluginSourceAn optional name assigned to the plugin that originated the invocation
resolveThe Promise resolve callback to be invoked when the API has concluded its execution
startTimeThe timestamp at which the API invocation was initialized
spanAn OpenTracing span for build tracing
traceIdAn optional argument provided to the object if the API invocation will lead to other API invocations
NOTE

For more information about the usage of traceId to await downstream API calls occurring due to the ongoing API invocation resulting in other calls to APIs, consult the Gatsby documentation.


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *