IsolateClient class

A [TypedLink} that executes requests of a Client in another isolate to avoid jank on heavy requests

Inheritance

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addRequestToRequestController<TData, TVars>(OperationRequest<TData, TVars> request) Future<void>
adds a request to the requestController of the client on the isolate this is useful for re-fetch and pagination see https://ferrygraphql.com/docs/pagination
clearCache() Future<void>
clearOptimisticPatches() Future<void>
concat(TypedLink next) TypedLink
Adds next after this typedLink
inherited
dispose() Future<void>
override
evict(String dataID, {String? fieldName, Map<String, dynamic>? args, OperationRequest? optimisticRequest}) Future<void>
gcCache() Future<Set<String>>
run garbage collection on the cache
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readFragment<TData, TVars>(FragmentRequest<TData, TVars> request, {bool optimistic = true}) Future<TData?>
readQuery<TData extends Object, TVars>(OperationRequest<TData, TVars> request, {bool optimistic = true}) Future<TData?>
read the given query from the cache. returns null if the result of the query is not cached
removeOptimisticPatch(OperationRequest request) Future<void>
request<TData, TVars>(OperationRequest<TData, TVars> request, [NextTypedLink<TData, TVars>? forward]) Stream<OperationResponse<TData, TVars>>
A function called when a request reaches this TypedLink
override
route(TypedLinkRouter route) TypedLink
Route requests after this typedLink
inherited
split(bool test<TData, TVars>(OperationRequest<TData, TVars> request), TypedLink left, [TypedLink right = const PassthroughTypedLink()]) TypedLink
Split requests after this typedLink
inherited
toString() String
A string representation of this object.
inherited
watchFragment<TData, TVars>(FragmentRequest<TData, TVars> request, {bool optimistic = true}) Stream<TData?>
watches the given fragment from the cache, no network request will be performed
watchQuery<TData, TVars>(OperationRequest<TData, TVars> request, {bool optimistic = true}) Stream<TData?>
watches the given query from the cache only, no network operations will be performed
writeFragment<TData, TVars>(FragmentRequest<TData, TVars> request, TData data, {OperationRequest<TData, TVars>? optimisticRequest}) Future<void>
writeQuery<TData extends Object, TVars>(OperationRequest<TData, TVars> request, TData response, {OperationRequest<TData, TVars>? optimisticRequest}) Future<void>

Operators

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

Static Methods

create<InitParams>(InitClient<InitParams> initClient, {required InitParams params, void messageHandler(Object?)?, SendPort? onError, SendPort? onExit, bool errorsAreFatal = false}) Future<IsolateClient>
Create a new IsolateClient. The IsolateClient will spawn a new Isolate, and create a standard Client on this Isolate given the passed InitClient function. initClient must a static or top-level function in order to be send over the isolate. if the initClient function needs params (e.g. a path for the HiveBox, since you cannot call path_provider on to other isolate without jumping through hoops), you can pass these params here. Note that params must only contain types that can be sent over Isolates. This essentials means, only data that you could also serialize to JSON. Note: isolates are not supported on the web. On the web, please use the standard Client.