@aws-amplify/api
- Version 6.4.3
- Published
- 75.3 kB
- 5 dependencies
- Apache-2.0 license
Install
npm i @aws-amplify/apiyarn add @aws-amplify/apipnpm add @aws-amplify/apiOverview
Api category of aws-amplify
Index
Functions
Type Aliases
Functions
function generateClient
generateClient: { < T extends Record<any, any> = never, Options extends CommonPublicClientOptions = DefaultCommonClientOptions >( ctx: AmplifyContext, options?: Options ): V6Client<T, Options>; < T extends Record<any, any> = never, Options extends CommonPublicClientOptions = DefaultCommonClientOptions >( options?: Options ): V6Client<T, Options>;};Generates an API client bound to a specific AmplifyContext instead of the global
Amplifysingleton. Use this overload when you need to scope a client to an explicit context (e.g. multi-tenant or server-side rendering scenarios) rather than the shared singleton configuration.Parameter ctx
The AmplifyContext the client should resolve its configuration and auth from.
Parameter options
Optional client options.
Returns
Throws
Error - Throws error when client cannot be generated due to configuration issues.
Example 1
import { generateClient } from 'aws-amplify/api';// `listTodos` is a generated GraphQL query document (from your API's codegen output).const client = generateClient(ctx);const result = await client.graphql({ query: listTodos });
Type Aliases
type Client
type Client<T extends Record<any, any> = never> = V6Client<T>;Package Files (2)
Dependencies (5)
Dev Dependencies (2)
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@aws-amplify/api.
- Markdown[](https://www.jsdocs.io/package/@aws-amplify/api)
- HTML<a href="https://www.jsdocs.io/package/@aws-amplify/api"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2936 ms. - Missing or incorrect documentation? Open an issue for this package.
