Overview
The gql_http_link package is a Flutter/Dart implementation that enables HTTP-based execution of GraphQL queries, mutations, and subscriptions using JSON. It acts as a terminating link in the GQL middleware chain, sending requests directly to a GraphQL server over HTTP. Designed for seamless integration with the gql-dart ecosystem, it supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux. The package simplifies communication with GraphQL APIs by handling serialization and deserialization of JSON data, making it ideal for apps requiring reliable and efficient GraphQL interactions.
Use cases
- Sending GraphQL queries to remote servers
- Executing mutations via HTTP
- Handling subscription data over HTTP
- Integrating with existing GraphQL backends
- Building cross-platform apps with GraphQL
- Simplifying API communication in Dart apps
Key features
- HTTP-based GraphQL execution
- JSON serialization/deserialization
- Cross-platform support
- Integration with gql-dart ecosystem
- Simple setup with flutter pub add
- Supports queries, mutations, and subscriptions
Suitable for
- Dart developers using GraphQL
- Apps needing HTTP-based GraphQL access
- Projects using the gql-dart library
- Cross-platform mobile and web applications
- Teams building REST-to-GraphQL bridges
- Developers seeking lightweight GraphQL clients
Considerations
- Requires a compatible GraphQL server
- Dependent on gql-dart core packages
- Limited to HTTP transport (no WebSocket)
- Not suitable for real-time streaming without additional setup
- May require manual error handling for network issues
- Best used within a larger GQL middleware pipeline