graphql_query_compress 1.0.0 graphql_query_compress: ^1.0.0 copied to clipboard
A package that eliminates unnecessary characters from a GraphQL query, saving several bytes on requests.
example/graphql_query_compress_example.dart
import 'package:graphql_query_compress/graphql_query_compress.dart';
void main() {
const query = r'''
mutation CreateShow($input: CreateShowInput!) {
createShow(input: $input) {
show {
id # we need this ID to buy a ticket
__typename
}
__typename
}
}
''';
final compressedQuery = compressGraphqlQuery(query);
print(compressedQuery);
// output: "mutation CreateShow($input:CreateShowInput!){createShow(input:$input){show{id __typename}__typename}}"
}