graphql_query_compress
1.0.0, released 3 years ago by an unverified publisher
Eliminates unnecessary characters from GraphQL queries to save bytes.
What it does
It removes whitespace and unnecessary characters from GraphQL queries. It integrates with GQL link serializers like HttpLink and DioLink to compress queries before requests are sent.
AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to reduce payload sizes for GraphQL requests
- You are using GQL-based links such as HttpLink or DioLink
Skip it when
- You are not using GraphQL in your application
- Human-readable query logs on the network layer are strictly required for debugging
Strengths
- Reduces payload size for GraphQL requests
- Easy integration with existing GQL request serializers
Weaknesses
- Limited utility outside of GraphQL workflows
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Replace the standard GQL RequestSerializer with RequestSerializerWithCompressor in your link configuration.
return GraphQLClient(
cache: GraphQLCache(store: null),
link: HttpLink(
_apiUrl,
serializer: const RequestSerializerWithCompressor(),
),
);Alternatives
Packages that do the same job and could replace graphql_query_compress.
- gql_http_link
HTTP link for executing GraphQL requests via JSON.
75Compare - graphql_2_rest
Converts GraphQL queries into REST-compatible POST bodies for any HTTP client.
50Compare
Works with
Packages commonly used together with graphql_query_compress: ones it builds on, ones built on it, and its own family.