JsonOperationRequest class
A OperationRequest that parses the response into a Map<String, dynamic> this is useful for when you don't have a generated class for the operation or as an escape hatch for when you want to parse the response yourself.
- Implemented types
-
- OperationRequest<
Map< String, dynamic> , Map<String, dynamic> >
- OperationRequest<
Constructors
-
JsonOperationRequest({required Operation operation, required FetchPolicy fetchPolicy, String? requestId, String? updateCacheHandlerKey, Map<
String, dynamic> ? updateCacheHandlerContext, bool executeOnListen = true, required Map<String, dynamic> vars, Map<String, dynamic> ? updateResult(Map<String, dynamic> ?, Map<String, dynamic> ?)?, Map<String, dynamic> ? optimisticResponse})
Properties
- execRequest → Request
-
no setteroverride
- executeOnListen → bool
-
If set to
true
, this request will be automatically added to the request controller when the stream returned byrequest()
is listened tofinal - fetchPolicy → FetchPolicy
-
The FetchPolicy to be used when executing this operation
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- operation → Operation
-
final
-
optimisticResponse
→ Map<
String, dynamic> ? -
The optimistic result, generally used when running a mutation
final
- requestId → String?
-
The unique identifier for this request.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
updateCacheHandlerContext
→ Map<
String, dynamic> ? -
An arbitrary JSON object that can be used to pass data to the UpdateCacheHandler
final
- updateCacheHandlerKey → String?
-
The key that maps to a UpdateCacheHandler, defined on the client
final
-
updateResult
→ (Map<
String, dynamic> ? Function(Map<String, dynamic> ?, Map<String, dynamic> ?)?) -
Optional function to update the result based on the previous result. Useful
for pagination.
final
-
vars
→ Map<
String, dynamic> -
final
Methods
-
dataToJson(
Map< String, dynamic> data) → Map<String, dynamic> -
Serializes data into a JSON object
This is a simple wrapper on the
toJson
method on the data classoverride -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseData(
Map< String, dynamic> json) → Map<String, dynamic> -
Parses data into a concrete type for the given operation
override
-
toString(
) → String -
A string representation of this object.
inherited
-
transformOperation(
Operation transform(Operation)) → JsonOperationRequest -
override
-
varsToJson(
) → Map< String, dynamic> -
Serializes variables into a JSON object
This is a simple wrapper on the
toJson
method on the variables classoverride
Operators
-
operator ==(
Object o) → bool -
The equality operator.
override