Vue OpenAPI Query Documentation
    Preparing search index...

    Type Alias QueryOptions<TResponse, TQueryParams, TError>

    QueryOptions: Omit<
        BaseQueryOptions<TResponse, TQueryParams, TError>,
        "queryKey" | "queryFn" | "enabled",
    > & {
        enabled?: ReactiveOr<boolean>;
        onLoad?: (data: TResponse) => void;
        axiosOptions?: AxiosRequestConfigExtended;
        errorHandler?: (
            error: AxiosError,
        ) => TResponse | void | Promise<TResponse | void>;
        skipGlobalError?: boolean | ((error: AxiosError<TError>) => boolean);
        queryParams?: ReactiveOr<TQueryParams>;
    }

    Options for useQuery composable. Accepts all TanStack Query options plus:

    • enabled: reactive boolean
    • queryParams: reactive query string parameters
    • onLoad: callback when data loads for the first time
    • errorHandler: custom error handler
    • axiosOptions: additional axios config

    Type Parameters

    • TResponse

      The response data type for this operation

    • TQueryParams extends Record<string, unknown> = Record<string, never>

      The query parameters type for this operation

    • TError = unknown

    Type Declaration

    • Optionalenabled?: ReactiveOr<boolean>
    • OptionalonLoad?: (data: TResponse) => void
    • OptionalaxiosOptions?: AxiosRequestConfigExtended
    • OptionalerrorHandler?: (error: AxiosError) => TResponse | void | Promise<TResponse | void>

      Use the onError policy on createApiErrorCaches instead. errorHandler swallows the error unless it rethrows, fires per retry attempt, and only receives AxiosError (non-axios throws bypass it). The cache-level onError policy fires once, after retries, and receives any rejection.

    • OptionalskipGlobalError?: boolean | ((error: AxiosError<TError>) => boolean)

      Suppress the client-level onError policy for this call. true → always suppress; function → suppress when it returns true (e.g. only on 409). The promise rejects either way; this controls the global side-effect only.

      Note: the predicate is only evaluated for axios errors. A non-axios throw (e.g. synthesised by a request interceptor) cannot be selectively suppressed; use skipGlobalError: true to always suppress.

      The predicate parameter is narrowed to AxiosError<TError> when TError is supplied. With the default TError = unknown it is AxiosError<unknown>.

    • OptionalqueryParams?: ReactiveOr<TQueryParams>