GraphQLClient class

Universal GraphQL Client with configurable caching and link system. modelled after the apollo-client.

The link is a Link over which GraphQL documents will be resolved into a Response. The cache is the GraphQLCache to use for caching results and optimistic updates.

The client automatically rebroadcasts watched queries when their underlying data changes in the cache. To skip the data comparison check, alwaysRebroadcast: true can be passed. NOTE: This flag was added ot accomodate the old default behavior. It is marked @experimental because it may be deprecated in the future.

Available extensions

Constructors

GraphQLClient({required Link link, required GraphQLCache cache, DefaultPolicies? defaultPolicies, bool alwaysRebroadcast = false, DeepEqualsFn? deepEquals, AsyncDeepEqualsFn? asyncDeepEquals, bool deduplicatePollers = false, Duration? queryRequestTimeout = const Duration(seconds: 5)})
Constructs a GraphQLClient given a Link and a Cache.

Properties

cache → GraphQLCache
The initial Cache to use in the data store.
final
defaultPolicies ↔ DefaultPolicies
The default Policies to set for each client action
latefinal
hashCode int
The hash code for this object.
no setterinherited
The Link over which GraphQL documents will be resolved into a Response.
final
queryManager ↔ QueryManager
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({Link? link, GraphQLCache? cache, DefaultPolicies? defaultPolicies, bool? alwaysRebroadcast, DeepEqualsFn? deepEquals, AsyncDeepEqualsFn? asyncDeepEquals, bool deduplicatePollers = false, Duration? queryRequestTimeout}) GraphQLClient
Create a copy of the client with the provided information.
fetchMore<TParsed>(FetchMoreOptions fetchMoreOptions, {required QueryOptions<TParsed> originalOptions, required QueryResult<TParsed> previousResult}) Future<QueryResult<TParsed>>
Fetch more results and then merge them with the given previousResult according to FetchMoreOptions.updateQuery.
getAccountHistory(String address, {int number = 10, String? cursor}) Future<Query$GetAccountHistory$transfers?>

Available on GraphQLClient, provided by the SquidAccountQueries extension

getAccountHistoryFiltered(String address, {int number = 20, String? cursor, TransactionFilters? filters}) Future<FilteredTransactionResult<Query$GetAccountHistoryFiltered$transfers$edges$node>?>

Available on GraphQLClient, provided by the SquidAccountQueries extension

Get filtered account history with server-side filtering
getAccountHistoryFilteredRaw(String address, {int number = 20, String? cursor, required Input$TransferFilter whereFilter}) Future<Query$GetAccountHistoryFiltered$transfers?>

Available on GraphQLClient, provided by the SquidAccountQueries extension

Raw GraphQL method for server-side filtered account history
getAccountPaymentStatus(String address) Future<AccountStatusResult?>

Available on GraphQLClient, provided by the SquidAccountQueries extension

Get account payment status for pre-payment warnings
getBlockByHash(String hash) Future<int?>

Available on GraphQLClient, provided by the SquidAccountQueries extension

getCertsReceived(String address) Future<Query$GetCertsReceived$identities$edges$node$certReceived?>

Available on GraphQLClient, provided by the SquidAccountQueries extension

getCertsSent(String address) Future<Query$GetCertsSent$identities$edges$node$certIssued?>

Available on GraphQLClient, provided by the SquidAccountQueries extension

getCombinedAccountHistory(String address, {int number = 10, String? cursor, bool includeUniversalDividends = true, DateTime? beforeTimestamp}) Future<CombinedAccountHistoryResult?>

Available on GraphQLClient, provided by the SquidAccountQueries extension

getIdentityMigrations(String address) Future<({Query$GetIdentityMigrations$changeOwnerKeys$edges$node? migrationFrom, Query$GetIdentityMigrations$changeOwnerKeys$edges$node? migrationTo})?>

Available on GraphQLClient, provided by the SquidAccountQueries extension

Get identity migrations for an address (both from and to) using a single optimized query
getIdentityName(String address) Future<String?>

Available on GraphQLClient, provided by the SquidAccountQueries extension

getNetworkActivity({int number = 20, String? cursor}) Future<Query$GetNetworkActivity$transfers?>

Available on GraphQLClient, provided by the SquidNetworkQueries extension

getNetworkActivityFiltered({int number = 20, String? cursor, TransactionFilters? filters}) Future<FilteredTransactionResult<Query$GetNetworkActivityFiltered$transfers$edges$node>?>

Available on GraphQLClient, provided by the SquidNetworkQueries extension

Get filtered network activity with server-side filtering
getNetworkActivityFilteredRaw({int number = 20, String? cursor, required Input$TransferFilter whereFilter}) Future<Query$GetNetworkActivityFiltered$transfers?>

Available on GraphQLClient, provided by the SquidNetworkQueries extension

Raw GraphQL method for server-side filtered network activity
getNetworkCertifications({int number = 20, String? cursor}) Future<Query$GetNetworkCertifications$certs?>

Available on GraphQLClient, provided by the SquidNetworkQueries extension

Get network-wide certification activity
getNetworkCertificationsFiltered({int number = 20, String? cursor, CertificationFilters? filters}) Future<FilteredCertificationResult<Query$GetNetworkCertificationsFiltered$certs$edges$node>?>

Available on GraphQLClient, provided by the SquidNetworkQueries extension

Get filtered network certifications with server-side filtering
getNetworkCertificationsFilteredRaw({int number = 20, String? cursor, required Input$CertFilter whereFilter}) Future<Query$GetNetworkCertificationsFiltered$certs?>

Available on GraphQLClient, provided by the SquidNetworkQueries extension

Get filtered network certifications with server-side filtering (Raw GraphQL method)
getNetworkIdentities({int number = 20, String? cursor}) Future<Query$GetNetworkIdentities$identities?>

Available on GraphQLClient, provided by the SquidNetworkQueries extension

Get network-wide identity activity
getNetworkIdentitiesFiltered({int number = 20, String? cursor, IdentityFilters? filters}) Future<FilteredIdentityResult<Query$GetNetworkIdentitiesFiltered$identities$edges$node>?>

Available on GraphQLClient, provided by the SquidNetworkQueries extension

Get filtered network identities with server-side filtering
getNetworkIdentitiesFilteredRaw({int number = 20, String? cursor, required Input$IdentityFilter whereFilter, List<Enum$IdentitiesOrderBy>? orderBy}) Future<Query$GetNetworkIdentitiesFiltered$identities?>

Available on GraphQLClient, provided by the SquidNetworkQueries extension

Get filtered network identities with server-side filtering (Raw GraphQL method)
getNetworkUdHistory({int number = 20, String? cursor}) Future<Query$GetNetworkUdHistory$udHistories?>

Available on GraphQLClient, provided by the SquidNetworkQueries extension

Get network-wide Universal Dividends history
getUdHistory(String address, {int number = 10, String? cursor}) Future<List<Query$GetUdHistoryViaIdentity$identities$edges$node$udHistory$edges$node>>

Available on GraphQLClient, provided by the SquidAccountQueries extension

isIdtyExist(String name) Future<bool>

Available on GraphQLClient, provided by the SquidAccountQueries extension

mutate<TParsed>(MutationOptions<TParsed> options) Future<QueryResult<TParsed>>
This resolves a single mutation according to the MutationOptions specified and returns a Future which resolves with the QueryResult or throws an Exception.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query<TParsed>(QueryOptions<TParsed> options) Future<QueryResult<TParsed>>
This resolves a single query according to the QueryOptions specified and returns a Future which resolves with the QueryResult or throws an Exception.
readFragment(FragmentRequest fragmentRequest, {bool optimistic = true}) Map<String, dynamic>?
pass through to cache.readFragment
readQuery(Request request, {bool optimistic = true}) Map<String, dynamic>?
pass through to cache.readQuery
resetStore({bool refetchQueries = true}) Future<List<QueryResult<Object?>?>>?
Resets the contents of the store with cache.store.reset() and then refetches of all queries unless refetchQueries is disabled
searchAddressByName(String name) Future<List<IdentitySuggestion>>

Available on GraphQLClient, provided by the SquidAccountQueries extension

Search identities by name with ranked results (exact matches first)
searchByAddress(String fragment) Future<List<IdentitySuggestion>>

Available on GraphQLClient, provided by the SquidAccountQueries extension

Search by address fragment (startsWith + endsWith)
subAccountHistory(String address) Stream<Subscription$SubAccountHistory$transfers$edges$node?>

Available on GraphQLClient, provided by the SquidSubscriptions extension

subscribe<TParsed>(SubscriptionOptions<TParsed> options) Stream<QueryResult<TParsed>>
This subscribes to a GraphQL subscription according to the options specified and returns a Stream which either emits received data or an error.
subscribeAccountActivity(String address) Stream<String?>

Available on GraphQLClient, provided by the SquidSubscriptions extension

Simple subscription to detect account activity (used as a trigger for refreshes)
subscribeCertActivity(String address) Stream<String?>

Available on GraphQLClient, provided by the SquidSubscriptions extension

Simple subscription to detect certification activity (used as a trigger for refreshes)
subscribeHistoryIssued(String address) Stream<Subscription$SubscribeHistoryIssued$accounts$edges$node?>

Available on GraphQLClient, provided by the SquidSubscriptions extension

subscribeIdentityName(String address) Stream<String?>

Available on GraphQLClient, provided by the SquidSubscriptions extension

Subscription to detect identity name changes for a specific address
subscribeNetworkActivity() Stream<String?>

Available on GraphQLClient, provided by the SquidSubscriptions extension

Simple subscription to detect network-wide activity (used as a trigger for refreshes)
subscribeNetworkCertifications() Stream<String?>

Available on GraphQLClient, provided by the SquidSubscriptions extension

Simple subscription to detect network-wide certification activity
subscribeNetworkIdentities() Stream<String?>

Available on GraphQLClient, provided by the SquidSubscriptions extension

Simple subscription to detect network-wide identity activity
toString() String
A string representation of this object.
inherited
watchMutation<TParsed>(WatchQueryOptions<TParsed> options) → ObservableQuery<TParsed>
watchMutation is the same as watchQuery, but with a different defaultPolicies that are more appropriate for mutations.
watchQuery<TParsed>(WatchQueryOptions<TParsed> options) → ObservableQuery<TParsed>
This registers a query in the QueryManager and returns an ObservableQuery based on the provided WatchQueryOptions.
writeFragment(FragmentRequest fragmentRequest, {bool? broadcast = true, required Map<String, dynamic> data}) → void
pass through to cache.writeFragment and then rebroadcast any changes.
writeQuery(Request request, {required Map<String, dynamic> data, bool? broadcast = true}) → void
pass through to cache.writeQuery and then rebroadcast any changes.

Operators

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