Function createOpenAPIClient
- createOpenAPIClient<ClientType extends "platform:api">(
urlOrFetch: string | OpenAPIClientFetch,
options?: OpenAPIClientOptions & { service?: ClientType },
): OpenAPIClientDefinitions[ClientType]Type Parameters
- ClientType extends "platform:api"
The
module:clienttype to create. Refers to an openAPIClient in the moduledefinition.yml
Parameters
- urlOrFetch: string | OpenAPIClientFetch
The URL of the service to connect to or a fetch call to use to connect to it.
Optionaloptions: OpenAPIClientOptions & { service?: ClientType }
Returns OpenAPIClientDefinitions[ClientType]
- ClientType extends "platform:api"
Create an typed openapi client either by URL or a 'fetch' callback. You can use a getDirectOpenAPIFetch to directly access a local service in-process (giving you better stacktraces and console logging)