@getanthill/datastore
Version:
Event-Sourced Datastore
34 lines (33 loc) • 1.02 kB
TypeScript
/// <reference types="node" />
import type { AxiosResponse } from 'axios';
import type Core from './Core';
import { EventEmitter } from 'events';
import { Telemetry } from '../typings';
export interface GraphQLConfig {
telemetry?: Telemetry;
}
export default class GraphQL extends EventEmitter {
static ERRORS: {};
private _config;
core: Core;
constructor(config: GraphQLConfig, core: Core);
/**
* GraphQL API
* @alpha
*
* @see https://graphql.org/learn/serving-over-http/#post-request
*
* @param query
* @param variables
* @param operationName
*/
request(type: string, query: string, variables?: {
[key: string]: string[];
}, operationName?: string): Promise<AxiosResponse>;
query(query: string, variables?: {
[key: string]: string[];
}, operationName?: string): Promise<AxiosResponse>;
mutation(query: string, variables?: {
[key: string]: string[];
}, operationName?: string): Promise<AxiosResponse>;
}