Back to Apollo Client

HttpLink

docs/source/api/link/apollo-link-http.mdx

3.14.11.1 KB
Original Source

<DocBlock canonicalReference="@apollo/client/link/http!HttpLink:class" customOrder={["summary", "remarks", "example"]} />

Constructor signature

ts
constructor(
  options: HttpLink.Options = {}
): HttpLink

Operation results

After your GraphQL endpoint successfully responds with the result of an operation, HttpLink sets the Response object as the response field of the operation context. This enables each previous link in your link chain to interact with the response.

Customizing fetch

Provide a custom fetch option to the HttpLink constructor if you need fine-grained control over the underlying fetch call. The function should behave identically to the Fetch API.

Types

<InterfaceDetails canonicalReference="@apollo/client/link/http!HttpLink.Options:interface" headingLevel={3} displayName="HttpLink.Options" />

<InterfaceDetails canonicalReference="@apollo/client/link/http!HttpLink.ContextOptions:interface" headingLevel={3} displayName="HttpLink.ContextOptions" />