Skip to content
pubscout

gql_dio_link

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

A GraphQL terminating link to execute requests via Dio using JSON.

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

What it does

Acts as a GraphQL Link for the gql ecosystem that delegates network requests to the Dio HTTP client. It allows executing GraphQL queries and mutations over Dio with support for features like file uploads.

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

Use it when

  • You are using the gql client ecosystem and want to use Dio as your underlying HTTP client
  • You need features provided by Dio such as custom interceptors for your GraphQL requests

Skip it when

  • Not documented
  • You are not using the gql/GraphQL link architecture

Strengths

  • Integrates GraphQL links with the popular Dio HTTP client
  • Supports multipart file uploads and query configuration options

Weaknesses

  • Dependent on the broader gql and dio package ecosystems breaking changes

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
5

Initialize a Dio instance and pass it to the DioLink constructor within your Link chain.

import "package:dio/dio.dart";
import "package:gql_link/gql_link.dart";
import "package:gql_dio_link/gql_dio_link.dart";

void main () {
  final dio = Dio();
  final link = Link.from([
    DioLink("/graphql", client: dio),
  ]);
}

Alternatives

Packages that do the same job and could replace gql_dio_link.

  • http

    If you prefer a simpler HTTP client stack instead of Dio for GraphQL links

Works with

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