gql_exec은 Dart에서 GraphQL 실행 계층을 구축하기 위한 핵심 패키지로, 링크와 클라이언트 생성을 지원하도록 설계되었습니다. 쿼리, 변형, 구독과 같은 GraphQL 작업을 처리하기 위한 핵심 유틸리티를 제공하여 GraphQL 서버와의 원활한 통합을 가능하게 합니다. 크로스플랫폼 호환성을 고려해 개발되어 Android, iOS, 웹, macOS, Windows, Linux에서 모두 작동합니다. 이 패키지는 gql-dart 생태계의 기반을 형성하며, Flutter 및 기타 Dart 애플리케이션에서 GraphQL 기능을 구현하는 개발자에게 가볍고 확장 가능한 기초를 제공합니다.
사용 사례
사용자 정의 GraphQL 클라이언트 빌드
링크를 통한 미들웨어 구현
크로스 플랫폼 앱에 GraphQL 통합하기
구독을 사용하여 실시간 데이터 처리
재사용 가능한 GraphQL 요청 파이프라인 만들기
주요 기능
GraphQL의 핵심 실행 로직
링크 및 클라이언트 추상화 지원
크로스 플랫폼 호환성
경량 및 모듈식 디자인
사용자 정의 동작을 위한 확장 가능한 아키텍처
적합한 대상
GraphQL 클라이언트를 처음부터 구축하는 개발자
gql-dart 생태계를 사용하는 팀
유연한 GraphQL 요청 처리가 필요한 응용 프로그램
다중 플랫폼을 대상으로 하는 프로젝트
GraphQL 흐름에 대한 세밀한 제어가 필요한 고급 사용자
고려 사항
GraphQL 개념에 익숙해야 합니다
고급 패키지 없이 직접 사용하기 위한 것이 아님
완전한 기능을 위해 다른 gql-dart 패키지에 의존합니다
더 큰 GraphQL 스택 내에서 사용하는 것이 가장 좋습니다
실행 계층을 초과한 독립적인 유틸리티는 제한적
원본 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):