Skip to content
pubscout

gql_http_link

1.2.0, released a year ago by gql-dart.dev

HTTP link for executing GraphQL requests via JSON.

WASM-readyQuiet but busy
$ flutter pub add gql_http_link
Source repository

What it does

Provides a terminating link that sends GraphQL operations over HTTP, handling JSON encoding/decoding and error mapping. It supports GET for queries, multipart uploads, and custom headers.

AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a lightweight GraphQL client that talks to a standard HTTP endpoint.
  • You prefer a composable link architecture over a monolithic client.
  • You want fine‑grained control over request/response handling.
  • You need to integrate with existing gql_link pipelines.

Skip it when

  • You already use a full‑featured HTTP client like dio and want to avoid extra dependencies.
  • You need advanced features like WebSocket subscriptions or gRPC support.

Strengths

  • Zero‑dependency on heavy HTTP clients; uses Dart's http package.
  • Fast JSON decoding via _JsonUtf8Decoder.
  • Composable with other gql_link links.
  • Supports multipart uploads and GET queries.

Weaknesses

  • Limited to HTTP; no WebSocket support.
  • No built‑in retry or caching logic.
  • Requires manual error handling for non‑200 responses.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
6

Add dependency and import package; no build_runner needed.

import "package:gql_link/gql_link.dart";
import "package:gql_http_link/gql_http_link.dart";

final link = Link.from([HttpLink("/graphql")]);

Alternatives

Packages that do the same job and could replace gql_http_link.

  • http2

    An HTTP/2 implementation in Dart for low-level transport and pooled HTTP/2 requests.

  • dio

    A powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.

  • alice

    Advanced HTTP network inspector and logger with a native UI for Flutter.

  • native_dio_adapter

    A Dio HTTP client adapter that uses native platform HTTP stacks via cupertino_http and cronet_http.

Works with

Packages commonly used together with gql_http_link: ones it builds on, ones built on it, and its own family.