Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Response<TGraph, TQuery>

Base class representing any response returned by API. Extends the native Response object of Fetch API and has all the data of the original response in addition to a few custom methods. You shouldn't need to construct instances of this class directly unless you're building a custom API client with this SDK.

Type Parameters

  • TGraph extends Core.Graph

  • TQuery extends Query<TGraph> | undefined = undefined

Hierarchy

Index

Constructors

Properties

_cache: Storage

Resolver cache implementing Web Storage API.

_console: Consola

Shared Consola instance.

_fetch: ((input: RequestInfo, init?: RequestInit) => Promise<Response>)

Type declaration

body: null | ReadableStream<Uint8Array>
bodyUsed: boolean
headers: Headers
ok: boolean
redirected: boolean
status: number
statusText: string
trailer: Promise<Headers>
url: string
v8n: { constructor: any } = ...

Type declaration

  • constructor: any

Methods

  • arrayBuffer(): Promise<ArrayBuffer>
  • Returns Promise<ArrayBuffer>

  • blob(): Promise<Blob>
  • Returns Promise<Blob>

  • Returns Response

  • formData(): Promise<FormData>
  • Returns Promise<FormData>

  • Gets JSON data from the response body and generates a followable response with a number of shortcuts for the most common actions.

    Returns Promise<FollowableResource<TGraph, TQuery>>

    Followable API response.

  • text(): Promise<string>
  • Returns Promise<string>

  • Returns Response

  • redirect(url: string, status?: number): Response
  • Parameters

    • url: string
    • Optional status: number

    Returns Response

Generated using TypeDoc