private function parseSingleMutationResult(array $res)
    {
        $mutationResult = $res['mutationResults'][0];

        if (isset($mutationResult['conflictDetected']) && $mutationResult['conflictDetected']) {
            throw new DomainException(
                'A conflict was detected in the mutation. ' .
                'The operation failed.'
            );
        }

        // cast to string for conformance between REST and gRPC.
        return (string) $mutationResult['version'];
    }