import { APIResponse } from "../types.js"; import { ERPApiConfig } from "../types.js"; export declare class GraphQLService { private client; private config; private endpoint; constructor(config: ERPApiConfig, endpoint: string, retryAttempts?: number, timeoutSeconds?: number); private getHeaders; /** * Handles a GraphQL response, properly handling both successful responses * and GraphQL-level errors (which come in a 200 HTTP response) * * From the GraphQL specification (https://spec.graphql.org/draft/#sec-Errors): > * "When a GraphQL server encounters an error, it should return a response with a > * top-level "errors" field containing the error information. The response may still contain * a partial result in the "data" field if the error occurred after some data was already resolved." * * And specifically about HTTP status codes: * "A server should return a 200 status code when a GraphQL operation successfully executes, including when * the operation returns errors. A server should return a 400 status code when a GraphQL operation fails to execute." */ private handleGraphQLResponse; /** * Executes a GraphQL query * @param query The GraphQL query string * @param variables Optional variables for the query * @returns The query result * @throws {HTTPError} For HTTP/network errors only */ query(query: string, variables?: Record): Promise>; /** * Executes a GraphQL mutation * @param mutation The GraphQL mutation string * @param variables Optional variables for the mutation * @returns The mutation result * @throws {HTTPError} For HTTP/network errors only */ mutate(mutation: string, variables?: Record): Promise>; /** * Cleanup all HTTP connections and resources * Call this when the service is no longer needed */ destroy(): Promise; } //# sourceMappingURL=graphql-service.d.ts.map