UNPKG

amplifyquery

Version:
27 lines (26 loc) 678 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setClient = setClient; exports.getClient = getClient; /** * API client to be used throughout the application. * This is injected by the library user. */ let _client = null; /** * Function to set the client. * @param client GraphQL client to inject. */ function setClient(client) { _client = client; } /** * Returns the currently configured client. * Throws an error if the client has not been set. */ function getClient() { if (!_client) { throw new Error("API client has not been configured. Please call AmplifyQuery.configure() first."); } return _client; }