gql_dedupe_link 패키지는 동일한 쿼리나 변형을 중복하여 실행하는 것을 방지하기 위해 동일한 요청을 중복 제거하는 Dart 및 Flutter용 GraphQL 링크입니다. 동일한 요청이 완료되기 전에 여러 번 발생할 경우, 단 한 번만 실행되며 이후 요청은 첫 번째 실행 결과를 받습니다. 이는 성능을 향상시키고 불필요한 네트워크 호출을 피하게 하며, 특히 빠른 사용자 입력이나 반복적인 UI 업데이트와 같은 상황에서 유용합니다. 링크는 gql 생태계와 원활하게 통합되며 모든 주요 플랫폼을 지원합니다.
사용 사례
사용자 상호작용이 빠를 때 중복 API 호출 방지
실시간 데이터 가져오기에서 성능 최적화
고주파 쿼리 시나리오에서 네트워크 부하 감소
자동 저장 또는 검색 제안을 통한 양식의 사용자 경험 개선
병행 GraphQL 작업에서 레이스 조건 처리
주요 기능
동일한 비행 중 요청의 자동 중복 제거
gql 클라이언트와의 원활한 통합
쿼리 및 변형을 지원합니다
필수 최소 구성
크로스 플랫폼 호환성
적합한 대상
Flutter 앱에서 gql 클라이언트를 사용하는 개발자
자주 또는 반복되는 GraphQL 작업을 가진 앱
네트워크 효율성과 UX 반응성을 우선시하는 팀
실시간 또는 양식 중심 애플리케이션
중복 서버 부하를 줄이려는 프로젝트
고려 사항
같은 작업이더라도 다른 변수를 가진 요청을 중복 제거하지 않을 수 있음
이미 완료된 요청에는 영향을 주지 않습니다
효과적인 중복 제거를 위해 적절한 변수 직렬화가 필요합니다
안정적이고 예측 가능한 쿼리 구조와 함께 사용하는 것이 가장 좋습니다
동일한 클라이언트 인스턴스 내에서 중복 제거에 한정
원본 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):