AppSync class

Constructors

AppSync({Duration cacheExpiry = const Duration(hours: 24)})

Properties

cacheExpiry Duration
The duration after which cache is invalidated [...]
final
hashCode int
The hash code for this object. [...]
read-only, inherited
logger Logger
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

execute({String endpoint, String query, Map variables, String accessToken, Database cache, CachePriority priority = CachePriority.network}) Future<Map>
Execute a GraphQL query without pagination. [...]
extractNextToken(Map data) String
getCacheDatabase({Directory root}) Future<Database>
Get database at 'root/aws_appsync_cache.db'. By default, root is set to path_provider's getTemporaryDirectory.
getCacheKey(String endpoint, String requestBody) int
Get a unique key for caching a request [...]
invalidateCache(DatabaseClient txn) Future<int>
Delete cache entries older than cacheExpiry. [...]
isCacheEntryExpired(Map entry) bool
Checks whether this cache entry is expired.
isNetworkError(dynamic e) bool
Return whether e should be treated as a network error
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
paginate({String endpoint, int batchSize = 100, String query, Map variables, String accessToken, Database cache, CachePriority priority = CachePriority.network}) Stream<Map>
Execute a GraphQL query with pagination. [...]
readCache(Database db, int cacheKey) Future<Map>
Read cache from db using cacheKey.
toString() String
A string representation of this object. [...]
inherited
updateCache(Database db, int cacheKey, Map data) Future<void>
Update cache with new data. Also invalidates stale cache as a bonus.

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited