validateOperationDataStructure function
Validates the structure of data
against the operation operationName
in document
.
Throws a PartialDataException if the data is invalid,
unless handleException=true
, in which case it returns false
.
Treats null
data as invalid, thus distinguishing between valid data,
and data which is simply not present as defined by the spec.
Calls denormalizeOperation internally.
Implementation
bool validateOperationDataStructure({
required DocumentNode document,
required Map<String, dynamic>? data,
String? operationName,
Map<String, dynamic> variables = const {},
bool addTypename = false,
bool handleException = false,
}) {
return _validateSelectionSet(
document: document,
getSelectionSet: ({required document, required fragmentMap}) =>
getOperationDefinition(document, operationName).selectionSet,
data: data,
variables: variables,
addTypename: addTypename,
handleException: handleException,
);
}