getMutation<DataType, ErrorType, VariablesType> method

Mutation<DataType, ErrorType, VariablesType>? getMutation<DataType, ErrorType, VariablesType>(
  1. String key, {
  2. bool exact = true,
})

Finds the Mutation

  • exact can be used to match the key exactly or by prefix

Implementation

Mutation<DataType, ErrorType, VariablesType>?
    getMutation<DataType, ErrorType, VariablesType>(
  String key, {
  bool exact = true,
}) {
  return cache.mutations
      .firstWhereOrNull(
          (query) => exact ? query.key == key : query.key.startsWith(key))
      ?.cast<DataType, ErrorType, VariablesType>();
}