readQuery<TData, TVars> method
TData?
readQuery<TData, TVars>(
- OperationRequest<
TData, TVars> request, { - bool optimistic = true,
Reads denormalized data from the Cache for the given operation.
Implementation
TData? readQuery<TData, TVars>(
OperationRequest<TData, TVars> request, {
bool optimistic = true,
}) {
final json = denormalizeOperation(
read: optimistic ? optimisticReader : (dataId) => store.get(dataId),
document: request.operation.document,
addTypename: addTypename,
operationName: request.operation.operationName,
variables: request.varsToJson(),
typePolicies: typePolicies,
dataIdFromObject: dataIdFromObject,
possibleTypes: possibleTypes,
allowDanglingReference: true,
);
return json == null ? null : request.parseData(json);
}