Skip to content
pubscout

graphql_query_compress

1.0.0, released 3 years ago by an unverified publisher

Eliminates unnecessary characters from GraphQL queries to save bytes.

WASM-ready
$ flutter pub add graphql_query_compress
Source repository

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.

Works with

Packages commonly used together with graphql_query_compress: ones it builds on, ones built on it, and its own family.