GraphiQL API Documentation
    Preparing search index...

    Type Alias Transport

    Wire-level transport. send() returns a single Promise for queries and mutations, or an AsyncIterable for subscriptions and incremental delivery (each event/chunk is wrapped in its own TransportResponse).

    type Transport = {
        method: HttpMethod;
        methodOverride?: HttpMethod;
        setMethod?: (method?: HttpMethod) => void;
        subscribe?: (listener: () => void) => () => void;
        supportedMethods: HttpMethod[];
        url: string;
        send(
            request: TransportRequest,
        ): Promise<TransportResponse> | AsyncIterable<TransportResponse, any, any>;
    }
    Index
    method: HttpMethod

    Effective query method for the latest known capabilities, or the explicit override. Use response.method to observe the method of an execution. createTransport always sends mutations through POST.

    methodOverride?: HttpMethod

    Explicit query method override, or undefined for automatic selection. Custom transports may omit this property when their selection policy is not observable.

    setMethod?: (method?: HttpMethod) => void

    Overrides the method for subsequent queries; undefined restores automatic QUERY → POST → GET selection. Queries reject if the override is unavailable after discovery. Mutations still require POST. Optional for custom transports that do not support method selection.

    subscribe?: (listener: () => void) => () => void

    Observe changes to the query method override or discovered capabilities. Read method, methodOverride and supportedMethods after each notification. Listener errors are logged without interrupting execution or other listeners. Returns a function that removes the listener.

    supportedMethods: HttpMethod[]

    Currently available HTTP methods. May change after discovery; an empty list means the endpoint advertises no usable methods.

    url: string

    The endpoint URL this transport sends requests to.