import type { TypedDocumentNode } from '@graphql-typed-document-node/core'; import type { RequestDocument, RequestOptions, Variables, VariablesAndRequestHeadersArgs } from '../helpers/types.js'; /** * Send a GraphQL Document to the GraphQL server for execution. * * @example * * ```ts * // You can pass a raw string * * await request('https://foo.bar/graphql', ` * { * query { * users * } * } * `) * * // You can also pass a GraphQL DocumentNode. Convenient if you * // are using graphql-tag package. * * import gql from 'graphql-tag' * * await request('https://foo.bar/graphql', gql`...`) * * // If you don't actually care about using DocumentNode but just * // want the tooling support for gql template tag like IDE syntax * // coloring and prettier autoformat then note you can use the * // passthrough gql tag shipped with graphql-request to save a bit * // of performance and not have to install another dep into your project. * * import { gql } from 'graphql-request' * * await request('https://foo.bar/graphql', gql`...`) * ``` */ export declare function request(options: RequestExtendedOptions): Promise; export declare function request(url: string, document: RequestDocument | TypedDocumentNode, ...variablesAndRequestHeaders: VariablesAndRequestHeadersArgs): Promise; export declare const parseRequestArgs: (documentOrOptions: RequestDocument | RequestOptions, variables?: V, requestHeaders?: HeadersInit) => RequestOptions; export type RequestExtendedOptions = { url: string; } & RequestOptions; export declare const parseRequestExtendedArgs: (urlOrOptions: string | RequestExtendedOptions, document?: RequestDocument, ...variablesAndRequestHeaders: VariablesAndRequestHeadersArgs) => RequestExtendedOptions; //# sourceMappingURL=request.d.ts.map