import { DocumentNode, GraphQLError } from 'graphql'; import { TypedDocumentNode } from '@graphql-typed-document-node/core'; export type ErrorPayload = { error: string; status: number; message: string; }; export type RequestOptions = NhostGraphqlRequestConfig & { document: RequestDocument | TypedDocumentNode; } & (V extends Record ? { variables?: V; } : keyof RemoveIndex extends never ? { variables?: V; } : { variables: V; }); export type Variables = { [key: string]: any; }; export type RequestDocument = string | DocumentNode; export type RemoveIndex = { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K]; }; export interface NhostGraphqlConstructorParams { /** * GraphQL endpoint. */ url: string; /** * Admin secret. When set, it is sent as an `x-hasura-admin-secret` header for all requests. */ adminSecret?: string; } export type NhostGraphqlRequestResponse = { data: null; error: GraphQLError[] | ErrorPayload; } | { data: T; error: null; }; /** Subset of RequestInit parameters that are supported by the graphql client */ export interface NhostGraphqlRequestConfig { headers?: Record; } //# sourceMappingURL=types.d.ts.map