gql
GraphQL 문서를 파싱하고 변환하며 인쇄하는 데 사용되는 GraphQL 도구입니다.
Dart에서 GraphQL을 지원하는 라이브러리
GraphQL 문서를 파싱하고 변환하며 인쇄하는 데 사용되는 GraphQL 도구입니다.
GraphQL SDL 및 문서용 유용한 빌더입니다. package:gql_code_builder 및 package:build 기반
*.graphql 문서와 SDL을 사용하여 유용한 클래스를 생성하는 Dart 코드 빌더.
비행 중 동일한 실행 요청을 중복 제거하는 GQL 링크
gql_http_link과 유사하게 gql_dio_link는 JSON을 사용하여 Dio를 통해 요청을 실행하는 GQL 종료 링크입니다.
실행 오류 및 예외를 처리하기 위한 GQL 링크
Link 및 Client를 지원하기 위한 GraphQL 실행 계층의 기초입니다.
HTTP를 통해 JSON을 사용하여 요청을 실행하는 GQL 종료 링크입니다.
간단하고 모듈식인 AST 기반의 GraphQL 요청 실행 인터페이스입니다.
GQL 링크는 요청과 응답을 변환하는 데 사용됩니다. 컨텍스트, 문서, 변수, 데이터, 오류 등을 업데이트하는 데 사용할 수 있습니다.
값이 부재하거나 존재하고 null인 경우 또는 존재하고 null이 아닌 경우를 나타내는 래퍼 클래스입니다.
GQL 웹소켓 링크
^6.3.2아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
gql-dart/gqlMIT License PRs Welcome Watch on GitHub Star on GitHub Watch on GitHub Discord
This is an effort to advance the Dart GraphQL ecosystem.
It consists of multiple packages and libraries centered around GraphQL AST.
Packages
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.
| Pub | Package | Library | Description |
|---|---|---|---|
| version | package:gql |
ast.dart |
GraphQL AST implementation with Visitor pattern and AST transformer |
| version | package:gql |
language.dart |
GraphQL source parser and printer. Recognizes both operations and SDL |
| version | package:gql |
document.dart |
Document and schema validation |
GraphQL language enables code generation to speed up development and move document processing to build-time.
We provide code builders to generate Dart source code and file builders which easily plug into standard Dart code generation pipeline.
Ideas for future work:
| Pub | Package | Library | Description |
|---|---|---|---|
| version | package:gql_code_builder |
Various builders | |
| version | package:gql_build |
File builders |
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.
Ideas for future work:
| Pub | Package | Library | Description |
|---|---|---|---|
| version | package:gql_exec |
gql_exec.dart |
Implementation of types for GraphQL requests and responses |
| version | package:gql_link |
link.dart |
Base for modular GraphQL execution interface |
| version | package:gql_http_link |
gql_http_link.dart |
Link to execute GraphQL requests via HTTP |
| version | package:gql_dedupe_link |
gql_dedupe_link.dart |
De-duplicating Link to avoid execution of identical requests |
| version | package:gql_transform_link |
gql_transform_link.dart |
GQL Link to transform Requests and Responses. May be used to update context, document, variables, data, errors, etc. |
| version | package:gql_websocket_link |
gql_websocket_link.dart |
GQL Link for subscriptions using websocket. |
| version | package:gql_dio_link |
gql_dio_link.dart |
Similar to gql_http_link, A GQL Terminating Link to execute requests via Dio using JSON. |
| Pub | Package | Library | Description |
|---|---|---|---|
| version | package:gql_pedantic |
Lint rules used by all gql-dart/gql packages |
| Pub | Package | Library | Description |
|---|---|---|---|
| version | package:gql_example_cli |
Example usage in a CLI environment | |
| version | package:gql_example_flutter |
Example usage in a Flutter environment |
| Project | Description |
|---|---|
| artemis | Build dart types from GraphQL schemas and queries (using Introspection Query). |
| graphql | A stand-alone GraphQL client for Dart, bringing all the features from a modern GraphQL client to one easy to use package. |
| graphql_flutter | A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package. |
| normalize | Normalization and denormalization of GraphQL responses in Dart |
| ferry | GraphQL Client for Dart |
| Your project? | Open a PR to add it to this readme! |
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.
This repository uses Melos to manage the monorepo and handle releases. The release process is partially automated through GitHub Actions.
The repository is organized into several package categories:
Core packages:
gql: Core GraphQL packagegql_tristate_valuegql_code_builder_serializersgql_code_builderExecution packages:
gql_execgql_linkLink implementations:
gql_http_linkgql_dio_linkgql_websocket_linkgql_dedupe_linkgql_error_linkgql_transform_linkBuild packages:
gql_buildTo get started with local development:
Install Melos:
dart pub global activate melos && dart pub get
Bootstrap the workspace:
melos bootstrap
Run tests:
melos test
The publish workflow is automated via GitHub Actions and triggers when:
master or release branches AND include changes to any pubspec.yaml fileThe automated process:
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
bump-patch for backward-compatible bug fixesbump-minor for backward-compatible featuresbump-major for breaking changesbump-alpha for prerelease versionsgraduate to promote prerelease versions to stablemelos bootstrap: Set up the workspacemelos clean: Clean all packagesmelos test: Run tests for all packagesmelos format: Format all packagesmelos analyze: Run static analysismelos build: Run build_runner for all packagesmelos publish: Publish packages to pub.devIf the automated publish fails:
melos testpubspec.yaml files are correctFor manual publishing (if needed, requires pub dev authentication):
melos publish --no-dry-run --yes --scope="package_name"
pubspec.yaml files automatically trigger the publish workflowPlease file feature requests and bugs at the GitHub.