@goteborgco/open-api-js-client
Version:
Official JavaScript client for the Göteborg & Co GraphQL API
73 lines (72 loc) • 2.07 kB
TypeScript
import { Guides } from './types/Guides';
import { Events } from './types/Events';
import { Places } from './types/Places';
import { Search } from './types/Search';
import { Taxonomies } from './types/Taxonomies';
import { Taxonomy } from './types/Taxonomy';
/**
* Main API client class for interacting with the Göteborg & Co GraphQL API
*
* This class provides access to all API endpoints through type-safe methods
* and supports raw GraphQL queries for advanced use cases.
*/
export declare class GoteborgCoApi {
private client;
private guidesInstance?;
private eventsInstance?;
private placesInstance?;
private searchInstance?;
private taxonomiesInstance?;
private taxonomyInstance?;
/**
* Initialize the API client
*
* @param apiUrl The base URL for the GraphQL API
* @param subscriptionKey Your API subscription key
*/
constructor(apiUrl: string, subscriptionKey: string);
/**
* Execute a raw GraphQL query
*
* @param query The complete GraphQL query string
* @returns The query result
* @throws Error If the query is empty or execution fails
*/
query<T = any>(query: string): Promise<T>;
/**
* Get the Guides API for accessing guide content
*
* @returns The Guides API instance
*/
guides(): Guides;
/**
* Get the Events API for accessing event content
*
* @returns The Events API instance
*/
events(): Events;
/**
* Get the Places API for accessing place content
*
* @returns The Places API instance
*/
places(): Places;
/**
* Get the Search API for performing content searches
*
* @returns The Search API instance
*/
search(): Search;
/**
* Get the Taxonomies API for listing available taxonomies
*
* @returns The Taxonomies API instance
*/
taxonomies(): Taxonomies;
/**
* Get the Taxonomy API for querying specific taxonomies
*
* @returns The Taxonomy API instance
*/
taxonomy(): Taxonomy;
}