gql_dio_link는 Dart용 GraphQL 종단 링크로, 강력한 HTTP 클라이언트인 Dio를 사용하여 GraphQL 요청을 실행할 수 있게 해줍니다. gql-dart 생태계와 원활하게 통합되어 있으며, Dio의 강력한 기능(인터셉터, 요청/응답 변환, 오류 처리 등)을 활용합니다. 효율적인 JSON 기반 통신을 위해 설계되었으며, 모바일, 웹, 데스크톱을 포함한 모든 주요 플랫폼을 지원합니다. GraphQL 워크플로우 내에서 유연한 HTTP 제어 및 고급 네트워킹 기능이 필요한 앱에 적합합니다.
사용 사례
사용자 정의 HTTP 로직과 GraphQL 통합
인증을 위한 Dio의 인터셉터 사용
복잡한 요청/응답 변환 처리
공유 네트워크 로직을 사용한 크로스플랫폼 앱 빌드
Dio를 통한 재시도 메커니즘 구현
헤더 및 타임아웃 사용자 지정
주요 기능
고급 HTTP 제어를 위한 Dio 기반 구축
JSON 기반의 GraphQL 실행을 지원합니다
미들웨어용 인터셉터를 제공
크로스 플랫폼 호환성
gql-dart와의 간편한 통합
사용자 정의 가능한 요청/응답 처리
적합한 대상
프로젝트에서 Dio를 사용하는 개발자
세밀한 HTTP 제어가 필요한 앱
확장 가능한 GraphQL 클라이언트를 구축하는 팀
플랫폼에 관계없이 네트워킹이 필요한 프로젝트
HTTP 미들웨어를 사용하여 GraphQL 동작을 확장하고자 하는 사용자
고려 사항
Dio에 익숙해야 합니다
추가 종속성 오버헤드
고급 구성에 대해 수동 설정이 필요할 수 있습니다
간단한 HTTP 사용 사례에 적합하지 않음
JSON 전송에 제한됨
gql-dart 생태계의 안정성에 따라 다름
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
gql-dart/gql
This is an effort to advance the Dart GraphQL ecosystem.
It consists of multiple packages and libraries centered around GraphQL AST.
Core
The core of this project is the GraphQL parser which parses GraphQL strings into an AST. The parsed AST can then be transformed, visited and printed back to GraphQL string.
To enable development of GraphQL clients, we provide type definitions used to execute GraphQL operations. They include AST-based operation, request with per operation context, and response. These types are used by the Links.
Link is the current client implementation. Link is GraphQL AST-aware request/response middleware. They can be used to build a pipeline to deduplicate requests, conditionally transform requests and responses (including the context), and eventually send the requests to the server.
The goal of this project is to expand Dart GraphQL ecosystem
and to build a community around this vendor-neutral implementation.
Community contributions are welcome.
Release Process
This repository uses Melos to manage the monorepo and handle releases. The release process is partially automated through GitHub Actions.
Repository Structure
The repository is organized into several package categories:
Core packages:
gql: Core GraphQL package
gql_tristate_value
gql_code_builder_serializers
gql_code_builder
Execution packages:
gql_exec
gql_link
Link implementations:
gql_http_link
gql_dio_link
gql_websocket_link
gql_dedupe_link
gql_error_link
gql_transform_link
Build packages:
gql_build
Local Development
To get started with local development:
Install Melos:
dart pub global activate melos && dart pub get
Bootstrap the workspace:
melos bootstrap
Run tests:
melos test
Release Process
Automated Publishing
The publish workflow is automated via GitHub Actions and triggers when:
Changes are pushed to the master or release branches AND include changes to any pubspec.yaml file
Manually triggered through GitHub Actions UI
The automated process:
Validates all packages (formatting, analysis, and tests)
Publishes packages in dependency order:
Core packages first
Execution packages second
Link implementation packages third
Build packages last
Manual Release Steps
To create a new release manually:
Ensure you're on the branch you want to release from (master or release)
Version the packages using one of the following commands:
# For a patch release
melos run bump-patch
# For a minor release
melos run bump-minor
# For a major release
melos run bump-major
# For an alpha release
melos run bump-alpha
# To graduate from prerelease(alpha) to stable
melos run graduate
Push the changes and tags:
git push && git push --tags
The GitHub Action will automatically handle publishing to pub.dev if changes include pubspec.yaml files
Versioning Rules
Use bump-patch for backward-compatible bug fixes
Use bump-minor for backward-compatible features
Use bump-major for breaking changes
Use bump-alpha for prerelease versions
Use graduate to promote prerelease versions to stable
Available Melos Commands
melos bootstrap: Set up the workspace
melos clean: Clean all packages
melos test: Run tests for all packages
melos format: Format all packages
melos analyze: Run static analysis
melos build: Run build_runner for all packages
melos publish: Publish packages to pub.dev
Troubleshooting
If the automated publish fails:
Check the GitHub Actions logs for specific errors
Ensure all tests are passing locally: melos test
Verify that version numbers in pubspec.yaml files are correct
Check that all dependencies are properly versioned
For manual publishing (if needed, requires pub dev authentication):