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
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.
Works with
Packages commonly used together with gql_dio_link: ones it builds on, ones built on it, and its own family.
- diogql_dio_link depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- gqlgql_dio_link depends on itParse, transform and print GraphQL documents in Dart.
- gql_linkgql_dio_link depends on itModular AST-based GraphQL request execution interface.
- gql_http_linkSame familyHTTP link for executing GraphQL requests via JSON.
- normalizeSame familyNormalizes and denormalizes GraphQL responses to a cache-friendly map structure.
- gql_code_builderSame familyDart code builder generating typed classes from GraphQL documents and SDL
- gql_buildSame familyUseful builders for your GraphQL SDL and documents.
- gql_websocket_linkSame familyGraphQL WebSocket link for executing queries, mutations, and subscriptions.