graphql_cache_inspector

Last updated:

0 purchases

graphql_cache_inspector Image
graphql_cache_inspector Images
Add to Cart

Description:

graphql cache inspector

A Flutter Plugin that helps to inspect the graphql cache on device
Features #

Visualizes the GraphQL Cache Data using simple lists

Usage #
import 'grapqhl_cache_inspector.dart' into your dart code.
import 'package:grapqhl_cache_inspector/grapqhl_cache_inspector.dart';
copied to clipboard
The GraphqlCacheInspector takes in a function that gets the cache data, as well as the data itself
GraphqlCacheInspector(
title: 'GraphQL Cache',
data: graphql.getCacheDump(),
getCacheData: graphql.getCacheDump,
);
copied to clipboard
You may perhaps use this as a page of its own by having a button that opens the CacheInspector,
using something like
ElevatedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: ((context) {
return GraphqlCacheInspector(
title: 'GraphQL Cache',
data: graphql.getCacheDump(),
getCacheData: graphql.getCacheDump,
);
}),
),
);
},
child: const Text('Get GraphQL Cache Dump'),
),
copied to clipboard
Here getCacheDump() would be a function that converts your cache into json, the exact implementation would depend on your store
For example if using Hive as your cache store we would define this as
Map<dynamic, Map<dynamic, dynamic>?> getCacheDump() {
return hivestore.box.toMap();
}
copied to clipboard
Additional information #
This is a WIP new package, expect breaking changes.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.